Deepak Sharma
Deepak Sharma

Reputation: 6477

supportedInterfaceOrientations not called on iOS 13

On iOS 13, pushing a view controller using segue such as "Show" causes supportedInterfaceOrientations not to be called on presented view controller(VC2). As a result, the controller autorotates to portrait mode even though supportedInterfaceOrientations returns only .landscape. However, if we push another view controller(VC3) from this controller(VC2) via any segue, VC3 does not autorotate.

The only workaround I have found is presenting VC2 as modal view controller using modal presentation style fullScreen. This is not I want on iPad devices, so looking for the reason why it is happening this way on iOS 13 and a fix.

Upvotes: 10

Views: 4749

Answers (1)

John Lanzivision
John Lanzivision

Reputation: 453

You have to set the 'presentation style' on the view controller to Full Screen, then the supportedInterface override will get called.

Story board

or check out this for even more info

How to present a modal atop the current view in Swift

Upvotes: 8

Related Questions