How to write Keyboard notifications in Swift 3
I'm trying to update this code to swift 3: NSNotificationCenter.defaultCenter().addObserver(self, selector: Selector("keyboardWillShow:"), name: UIKeyboardWillShowNotification, object: nil) NSNotificationCenter.defaultCenter().addObserver(self, selector: Selector("keyboardWillHide:"), name: UIKeyboardWillHideNotification, object: nil)` So far, I've just tried the auto corrections given by the compiler. This results in code like this: let notificationCenter = NotificationCenter.default() notificationCenter.addObserver(self, selector: Selector(("keyboardWillShow:")), name: NSNotification.Name