Ios Swift 3:UIDevice.current.orientation报告landscapeLeft和landscapeRight的交换值

Ios Swift 3:UIDevice.current.orientation报告landscapeLeft和landscapeRight的交换值,ios,swift,swift3,orientation,Ios,Swift,Swift3,Orientation,除了基于UIdevice.current.orientation进行设置外,LandscapeRight在应用程序中的其他任何位置都能正常工作。纵向/上部报告正常。“景观”方向值的打印输出显示的与它们应该显示的方向相反(当它实际位于“景观右侧”中时为“景观左侧”)。这不是由于条件错误,即说!=UIDevice.current.orientation的实际值不是==,而是错误的。这发生在多台设备上,从多台计算机生成,并发生在两个单独的应用程序中 诸如此类 open override var sup

除了基于UIdevice.current.orientation进行设置外,LandscapeRight在应用程序中的其他任何位置都能正常工作。纵向/上部报告正常。“景观”方向值的打印输出显示的与它们应该显示的方向相反(当它实际位于“景观右侧”中时为“景观左侧”)。这不是由于条件错误,即说!=UIDevice.current.orientation的实际值不是==,而是错误的。这发生在多台设备上,从多台计算机生成,并发生在两个单独的应用程序中

诸如此类

open override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
    return .landscapeRight
}
提供预期的行为


有人经历过这种情况吗?有人知道是什么原因造成的吗?

uiinterface-orientation
UIDeviceOrientation
是不同的
UIInterfaceOrientationAndscapeLeft==UIDeviceOrientationAndscapeRight
UIInterfaceOrientationAndscapeRight==UIDeviceOrientationAndscapeLeft
通常应避免使用设备方向。获取应用程序当前方向的最简单方法是使用
UIApplication.shared.statusBarInterfaceOrientation
@R.P.Carson,因为当您将设备向左旋转时,您的界面会向右旋转