我很关心faceUp,faceDown landScape定位在swift 4.2中,有一些帮助方法可以检查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