Here is my code which was working before.
NotificationCenter.default.addObserver(self, selector: #selector(ImageScrollView.changeOrientationNotification), name: Notification.Name.UIDevice.orientationDidChangeNotification, object: nil)
Remove Notification.Name.
prefix:
NotificationCenter.default.addObserver(self, selector: #selector(ImageScrollView.changeOrientationNotification), name: UIDevice.orientationDidChangeNotification, object: nil)
The constants for notifications names were moved in iOS 12 SDK which came with Xcode 10.
April 9th 2020, I ran into a similar problem. I've got:
name: Notification.Name.UIKeyboardWillHide
And I had to "Replace 'UIKeyboardWillHide' with 'UIResponder.keyboardWillHideNotification'" I clicked "fix" and got:
name: Notification.Name.UIResponder.keyboardWillHideNotification,
After that I got "Type 'Notification.Name' (aka 'NSNotification.Name') has no member 'UIResponder'". And finally, Thanks to you guys, I figured out:
name: UIResponder.keyboardFrameEndUserInfoKey.
Maybe my case and the answer will also help some beginner))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With