Presenting a UIViewController when on landscape orientation

258 views Asked by At

What is the best way to show a UIViewController only when the device is on landscape mode? The modal view controller should present itself modally when the device is on landscape mode and should dismiss itself when going back to portrait.

Since - (BOOL)shouldAutorotateToInterfaceOrientation :(UIInterfaceOrientation)toInterfaceOrientation is only called once (and not for every UIViewController), how should the navigation controller be set up?

1

There are 1 answers

2
AudioBubble On BEST ANSWER

The method you're looking for is

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)o duration:(NSTimeInterval)t;