I am having trouble trying to migrate my piece of code from Swift 3 to Swift 4.2
here is the current code to be migrated:
fileprivate func observeKeyboardNotifications() {
NotificationCenter.default.addObserver(self, selector: #selector(keyboardShow), name: .UIKeyboardWillShow, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(keyboardHide), name: .UIKeyboardWillHide, object: nil)
}
Here's what I have managed to do :
fileprivate func observeKeyboardNotifications() {
NotificationCenter.default.addObserver(self, selector: #selector(keyboardShow), name: NSNotification.Name.UIResponder.UIKeyboardWillShowNotification, object: nil)
}
And still I get the error:
Type of expression is ambiguous without more context
I've been all day coding, so I can't really even see what's wrong with this code. Can anybody help me solve this?