I have only a single screen portrait app in landscape only mode.
What I did: I created a subclass of UINavigationController and redefined the following:
import UIKit
class LandscapeVCNavigationController: UINavigationController {
override func viewDidLoad() {
super.viewDidLoad()
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .landscape
}
override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
return .landscapeLeft
}
}
Then, using this navigationController to present your landscape view manager as follows:
if let vc = storyboard?.instantiateViewController(withIdentifier: StoryBoardIdentifiers.playerVCStoryboardIdentifier) as? PlayerViewController {
let navController = LandscapeVCNavigationController.init(rootViewController: vc)
present(navController, animated: true, completion: {
})
}
This works great.
What I need:
I need a landscape VC, which will be presented from below (the main button on the button), and should deviate to the bottom (home button). This is what is happening now.
source
share