Add these lines to register for keyboard notifications.
NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyboardWillShow:", name: UIKeyboardWillShowNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyboardDidShow:", name: UIKeyboardDidShowNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyboardWillHide:", name: UIKeyboardWillHideNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyboardDidHide:", name: UIKeyboardDidHideNotification, object: nil)
These methods will recieve the notifications.
func keyboardWillShow(notification: NSNotification) {
}
func keyboardDidShow(notification: NSNotification) {
}
func keyboardWillHide(notification: NSNotification) {
}
func keyboardDidHide(notification: NSNotification) {
}