user448236
user448236

Reputation: 693

Which method will be called when the iOS device turn into Landscape mode?

I know that I can return YES to support Landscape mode in shouldAutorotateToInterfaceOrientation. But I would like to display a new view, when the user turn the device into landscape mode, how can I do so? thank you.

Upvotes: 0

Views: 192

Answers (3)

A useful technique for just this case is, to present a new modal view controller with a "fade" transition from your current view. You can do this in reaction to UIDeviceOrientationDidChangeNotification as mentioned previously by Aaron.

Upvotes: 0

shimdh
shimdh

Reputation: 79

[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];

Upvotes: -1

Aaron Saunders
Aaron Saunders

Reputation: 33345

Observer this event UIDeviceOrientationDidChangeNotification

[[NSNotificationCenter defaultCenter] addObserver:self 
           selector:@selector(orientationDidChange:)
           name:UIDeviceOrientationDidChangeNotification object:nil];

Upvotes: 2

Related Questions