viewWillTransitionToSize:withTransitionCoordinator: Not being called automatically

671 views Asked by At

I want to call the iOS 8 method viewWillTransitionToSize:withTransitionCoordinator: to handle transitioning to different device orientations but it does not seem to be called automatically. I have previously handled orientation changes via NSNotifications (i.e. orientationChanged:).

I have included NSLogs within the viewWillTransitionToSize:withTransitionCoordinator: method but they are never called and the following code didn't help either:

-(NSUInteger)supportedInterfaceOrientations{
  return UIInterfaceOrientationMaskAll;
}

Anyone else experience any similar issues with this method?

1

There are 1 answers

0
user3784214 On BEST ANSWER

Problem solved. I had a navigation controller that had the following method:

- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskPortrait;
}

Changing to UIInterfaceOrientationMaskAll fixed the issue.