Since willAnimateRotationToInterfaceOrientation
is deprecated in iOS 8 (and we should use - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
), how do I know the interfaceOrientation the user is going to rotate?
Yes, I could read the size value to know proportions, but it doesn't tell me the difference between UIInterfaceOrientationLandscapeLeft
and UIInterfaceOrientationLandscapeRight
.
As you rightly say, you are receiving this event:
- (void)viewWillTransitionToSize:(CGSize)size
withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator)
The second parameter is a transition coordinator. Use it! It has a targetTransform
property that tells you what's about to happen.