Here is my function for adding an observer
func subscribeToKeyboardNotifications() {
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow), name: .UIKeyboardWillShow, object: nil)
}
but .UIKeyboardWillShow
is giving me an error
'UIKeyboardWillShow' has been renamed to 'UIResponder.keyboardWillShowNotification'
Replace 'UIKeyboardWillShow' with 'UIResponder.keyboardWillShowNotification'
but when I replace it
func subscribeToKeyboardNotifications() {
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow), name: .UIResponder.keyboardWillShowNotification, object: nil)
}
I get this error
Type of expression is ambiguous without more context