I want to know how to disable/enable rotation during view life. Is there a way to update shouldAutorotate in the view life(without reloading the view)
Thanks.
I want to know how to disable/enable rotation during view life. Is there a way to update shouldAutorotate in the view life(without reloading the view)
Thanks.
From the Apple Docs :
Declaration SWIFT func shouldAutorotate() -> Bool
OBJECTIVE-C - (BOOL)shouldAutorotate
You should add this to the method where you decide if the user can rotate or not of your ViewController :
override func shouldAutorotate() -> Bool {
return false
}
See also : Setting device orientation in Swift iOS