Swift Int不可转换为UIInterfaceOrientationMak,用于supportedInterfaceOrientations()
我对Xcode 7还有一个问题。我做了一些研究,但没有找到解决办法。错误为Int不能转换为UIInterfaceOrientationTask。代码如下:Swift Int不可转换为UIInterfaceOrientationMak,用于supportedInterfaceOrientations(),swift,int,uiinterfaceorientation,swift2,xcode7,Swift,Int,Uiinterfaceorientation,Swift2,Xcode7,我对Xcode 7还有一个问题。我做了一些研究,但没有找到解决办法。错误为Int不能转换为UIInterfaceOrientationTask。代码如下: override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask { if visibleViewController is KINWebBrowserViewController { return Int(UIInterfaceOrient
override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
if visibleViewController is KINWebBrowserViewController { return Int(UIInterfaceOrientationMask.All.rawValue) }
return Int(UIInterfaceOrientationMask.Portrait.rawValue)
}
谢谢Swift 3.x
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return visibleViewController is KINWebBrowserViewController ? .all : .portrait
}