我对 swift 4.2 中的 faceUp、faceDown 横向方向很感兴趣,以前有帮助方法来检查横向的 faceUp、faceDown。任何人都知道这个辅助函数的替代方法。提前致谢。
UIDeviceOrientationIsLandscape(orientation)
我使用状态栏方向修复了我的问题。
if UIApplication.shared.statusBarOrientation == .landscapeLeft || UIApplication.shared.statusBarOrientation == .landscapeRight || UIApplication.shared.statusBarOrientation.isLandscape { return true}
所以如果你使用UIDeviceOrientationIsLandscape
这个函数,你可以用上面的代码替换它。
我进行了一些搜索和替换:
UIDeviceOrientationIsLandscape(orientation)
是
UIDevice.current.orientation.isLandscape