我试图锁定我viewController只是纵向方向,而不必依赖于部署信息,但我的以下代码不起作用
override var shouldAutorotate: Bool {
return false
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return UIInterfaceOrientationMask.portrait
}
override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
return UIInterfaceOrientation.portrait
}
override func viewDidLoad() {
super.viewDidLoad()
}
Run Code Online (Sandbox Code Playgroud)