I've got an Objetive-C app delegate that is part of a project I'm interfacing with my own. I'm attempting to lock orientation, but it looks like the old methods (below) no longer work. Setting the orientation in viewDidLoad
rotates the screen but allows the user to rotate back to portrait
. I've attempted converting to "override var"
but no luck. The current solutions (link below) look to all involve an app delegate
call, but I cannot locate the solution for a Swift call to an Objective C
app delegate.
How to lock orientation of one view controller to portrait mode only in Swift
override func shouldAutorotate() -> Bool {
return false
}
override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
return UIInterfaceOrientationMask.landscapeRight
}