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)
}
}
ViewController.Swift
를 들어
AppDalgate.Swift
func application (application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow?) -> UIInterfaceOrientationMask {
return checkOrientation(self.window?.rootViewController)
}
에게 AppDalgate.Swift이 코드를이 오류가
재귀 적으로'checkOrientation'을 호출하여 얻으려는 것이 확실하지 않습니다. – Ike10