【发布时间】:2016-06-25 00:29:16
【问题描述】:
当我尝试键入 Return My Func 时,我在 AppDalgate.Swift 中收到此错误
AppDalgate.Swift
func application (application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow?) -> UIInterfaceOrientationMask {
return checkOrientation(self.window?.rootViewController)
}
ViewController.Swift 的代码
func checkOrientation(viewController:UIViewController?)-> Int{
if(viewController == nil){
return Int(UIInterfaceOrientationMask.All.rawValue)//All means all orientation
}else if (viewController is LoginViewController){
return Int(UIInterfaceOrientationMask.Portrait.rawValue)//This is sign in view controller that i only want to set this to portrait mode only
}else{
return checkOrientation(viewController!.presentedViewController)
}
}
【问题讨论】:
-
也不清楚你通过递归调用
checkOrientation来获得什么
标签: xcode swift swift2 ios9 xcode7