我对faceUp很好奇,在swift 4.2中的faceDown横向定向显然有帮助者方法来检查faceUp,在横向定向中的faceDown。任何人都知道这个helper函数的替代方法。提前谢谢。

UIDeviceOrientationIsLandscape(orientation)

最佳答案

我用状态栏方向修正了我的问题。

if UIApplication.shared.statusBarOrientation == .landscapeLeft || UIApplication.shared.statusBarOrientation == .landscapeRight || UIApplication.shared.statusBarOrientation.isLandscape { return true}

因此,如果您使用UIDeviceOrientationIsLandscape这个函数,您可以用上面的代码替换它。

10-07 19:27
查看更多