Aquí está mi código que estaba funcionando antes.
NotificationCenter.default.addObserver(self, selector: #selector(ImageScrollView.changeOrientationNotification), name: Notification.Name.UIDevice.orientationDidChangeNotification, object: nil)Quitar Notification.Name. prefijo:
NotificationCenter.default.addObserver(self, selector: #selector(ImageScrollView.changeOrientationNotification), name: UIDevice.orientationDidChangeNotification, object: nil)Las constantes para los nombres de las notificaciones se movieron en iOS 12 SDK que venía con Xcode 10.
El 9 de abril de 2020, me encontré con un problema similar. Tengo:
name: Notification.Name.UIKeyboardWillHideY tuve que "Reemplazar 'UIKeyboardWillHide' con 'UIResponder.keyboardWillHideNotification'". Hice clic en "arreglar" y obtuve:
name: Notification.Name.UIResponder.keyboardWillHideNotification,Después de eso, obtuve "Tipo 'Notification.Name' (también conocido como 'NSNotification.Name') no tiene miembro 'UIResponder'". Y finalmente, gracias a ustedes, descubrí:
name: UIResponder.keyboardFrameEndUserInfoKey.Tal vez mi caso y la respuesta también ayuden a algunos principiantes))