kvr*_*a13 1 swift ios9 xcode7 swift2
我试图让我的应用程序只是在纵向模式iam使用navigationcontroller我得到这个错误iam usring Xcode7和Swift 2目标系统IOS 9.3
声明只在文件范围有效
extension UINavigationController {
public override func supportedInterfaceOrientations() -> Int {
return visibleViewController.supportedInterfaceOrientations()
}
public override func shouldAutorotate() -> Bool {
return visibleViewController.shouldAutorotate()
}
}
extension UITabBarController {
public override func supportedInterfaceOrientations() -> Int {
if let selected = selectedViewController {
return selected.supportedInterfaceOrientations()
}
return super.supportedInterfaceOrientations()
}
public override func shouldAutorotate() -> Bool {
if let selected = selectedViewController {
return selected.shouldAutorotate()
}
return super.shouldAutorotate()
}
}
Run Code Online (Sandbox Code Playgroud)
日Thnx