8 Replies
      Latest reply on Oct 25, 2019 9:16 AM by Monimonica
      Devgeek Level 1 Level 1 (0 points)

        iOS 13/13.1 autorotation seems to be behave differently than iOS 12. For instance, my app allows user to lock interface orientation to portrait or landscape mode in settings.

        1. If I have portrait rotation lock on device and return only .landscape mode as supportedInterfaceOrientations, the interface remains in portrait mode only until I disable portrait lock orientation on device. This does not seem to be the case with iOS 12. Infact, supportedInterfaceOrientations is not even called!
        2. UIViewController.attemptRotationToDeviceOrientation() also does not work in such cases.

        The root of the problem is I temporarily return shouldAutorotate to false while the app is initializing and when everything is initialized, I call UIViewController.attemptRotationToDeviceOrientation() to trigger autorotation. It triggers autorotation in iOS 12 but in iOS 13.1 it doesn't works.

        Looks like a bug in iOS 13.1 I believe. What's a known workaround?