I had this function to move certain textfields upwards, when the keyboards would block their view - I'm sure you all know about this:
override func viewDidLoad() {
super.viewDidLoad()
let center: NotificationCenter = NotificationCenter.default
center.addObserver(self, selector: #selector(keyboardDidShow(notification:)), name: NSNotification.Name?.UIKeyboardDidShow, object: nil)
center.addObserver(self, selector: #selector(keyboardWillHide(notification:)), name: NSNotification.Name?.UIKeyboardWillHide, object: nil)
}
But when I recently updated to swift 4.2, these stopped working, and these suggestions came up:
Replace 'UIKeyboardDidShow' with 'UIResponder.keyboardDidShowNotification' &
Replace 'UIKeyboardWillHide' with 'UIResponder.keyboardWillHideNotification
But when I pressed "fix", I get the error (x2):
Type 'NSNotification.Name' has no member 'UIResponder'
It kind of seems like a bug to me? That xCode can't accept it's own changes?? Anybody came across this and knows what to do?
Thanks!