这是我以前工作的代码。
NotificationCenter.default.addObserver(self, selector: #selector(ImageScrollView.changeOrientationNotification), name: Notification.Name.UIDevice.orientationDidChangeNotification, object: nil)
Run Code Online (Sandbox Code Playgroud)
删除Notification.Name.前缀:
NotificationCenter.default.addObserver(self, selector: #selector(ImageScrollView.changeOrientationNotification), name: UIDevice.orientationDidChangeNotification, object: nil)
Run Code Online (Sandbox Code Playgroud)
通知名称的常量已在Xcode 10随附的iOS 12 SDK中进行了移动。
| 归档时间: |
|
| 查看次数: |
1657 次 |
| 最近记录: |