Post

Replies

Boosts

Views

Activity

Reply to willTransition not triggered when flipping device in landscape mode
I am facing the same problem. A navigation app needs to update the headingOrientation property on CLLocationManager to get heading updates relative to the user interface orientation. So I wanted to use [UIViewController viewWillTransitionToSize:withTransitionCoordinator:] to detect user interface orientation changes, but this method is not called when the device if flipped from landscape left to right via upside-down (which is not supported and therefore not reported). Alternatives: UIDeviceOrientationDidChangeNotification's may not be in sync with UIKit when the user has the orientation lock activated [UIViewController didRotateFromInterfaceOrientation:] is deprecated EDIT: The solution is to use [UIViewController viewWillTransitionToSize:withTransitionCoordinator.] which is called even though the size is not changed.
Mar ’22