I have an app whose root view controller is in the portrait mode. But I want to fix one of its child view controller to landscapeLeft. How can I realize this?
My project setting include both landscapeLeft and portrait orientations for the app.
In root view controller:
override var shouldAutorotate: Bool {
return false
}
override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation
{
return .portrait
}
In the child view controller:
override var shouldAutorotate: Bool {
return false
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .landscapeLeft
}
override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation
{
return .landscapeLeft
}
But it seems that the child view controller is still fixed at the portrait mode, maybe dominated by the setting in the root view controller? If so, how should I adjust to realize my goal?
Hope some one can provide insights here. Just want to make sure I'm looking at the right place.
Thanks a lot!
Regards, Paul