I need to orientation support in single view controller
I try but did not work. Right now orientation in whole app.
override func viewDidLoad() {
super.viewDidLoad()
self.lockOrientation()
}
func lockOrientation() {
let orientationValue = UIInterfaceOrientation.portrait.rawValue
UIDevice.current.setValue(orientationValue, forKey: "orientation")
}
override var shouldAutorotate: Bool {
return false
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .portrait
}
override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
return .portrait
}