I have an UIViewController, I want to disable or enable rotation of the screen in different scenarios
Example:
if flag { rotateDevice = false } e
Found this to be by far the simplest implementation, and adaptable to use on specific view controllers. Add this to viewController class, after viewDidLoad()
viewDidLoad()
override open var shouldAutorotate: Bool { return false }