iOS. Interface orientation on launch

187 views Asked by At

I have an app that supports both portrait and landscape.
So in Info.plist / Project Settings I specify both orientations.

In my UIViewController I override supportedInterfaceOrientations to return .landscape.

But when I launch my app it is first displayed in portrait mode (with wrecked layout), and then unpleasant animation rotates it to landscape (see video).

I also tried overriding application(_, supportedInterfaceOrientationsFor window) with the same result.

Sample project demonstrating the issue:
https://s3.amazonaws.com/glazba/OrientationTest.zip

Orientation issue video

1

There are 1 answers

2
Lobont Andrei On

Adding UIInterfaceOrientation in Info.plist and setting it to landscape seems to do the trick.