IOS 10 disable autorotation

iOS 10 with the Autolayout and Size classes gives nightmares for simple questions that were easy before. I run my app in landscape mode and want to disable autorotation until everything is configured, after which I manually start autorotation via the API

   UIViewController.attemptRotationToDeviceOrientation()

      

But no matter what I do, the interface autorotates in portrait mode if the device is held vertically. Here's what I've tried:

and. In Storyboard, I choose landscape orientation in each of the traits (not sure if this really applies to landscape mode)

b. Set the initial orientation in info.plist file to landscape,

from. Return false in shouldAutorotate {},

e. Return only .landscapeLeft in supportedInterfaceOrientations

But even then the boundaries of view go out (start = (x = 0, y = 0), size = (width = 375, height = 667)). I want the borders to display width = 667 and height = 375. How do I do this?

+3


source to share





All Articles