let navVC = UINavigationController(rootViewController: destinationVC)
navVC.modalPresentationStyle = .overFullScreen
viewController?.present(navVC, animated: true, completion: nil)
此块之后,在屏幕上显示了可以自动旋转的vc。但是出现navVC的vc也会自动旋转。如何解决此错误?
代码AppDelegate:
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
let presentedViewController = UIHelper.topViewController()
if presentedViewController is FullOrientationRotate {
print("presentedViewController is ", presentedViewController)
return .all
}
return .portrait
}