Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Autorotation</strong> has changed in iOS 6. In iOS 6, the <code>shouldAutorotateToInterfaceOrientation:</code> method of UIViewController is deprecated. In its place, you should use the <code>supportedInterfaceOrientations:</code> and <code>shouldAutorotate</code> methods:</p> <pre><code>- (BOOL)shouldAutorotate { return YES; } - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskAllButUpsideDown; } </code></pre> <p><strong>Modal ViewControllers</strong> no longer get rotation calls in iOS 6: The <code>willRotateToInterfaceOrientation:duration:, willAnimateRotationToInterfaceOrientation:duration:</code>, and <code>didRotateFromInterfaceOrientation:</code> methods are no longer called on any view controller that makes a full-screen presentation over itself—for example those that are called with: <code>presentViewController:animated:completion:</code>.</p> <p><a href="https://stackoverflow.com/questions/12554204/ios-6-rotation-issue-no-rotation-from-presented-modal-view-controller/12555205#12555205">This answer will further explain the rotation changes in iOS 6</a></p> <hr> <p>[EDIT] Completely different way is to register for rotation events. The advantage is that all objects can register for this, not only <code>UIViewController</code>. This is usually done when the view loads and stopped when the view disappears (put in dealloc here). The method in the selector is called when orientation changes (here it is <code>orientationChanged:</code>):</p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; // Start generating device rotations and register for them [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:UIDeviceOrientationDidChangeNotification object:nil]; } - (void)dealloc { // Deregister and stop generating device rotations [[NSNotificationCenter defaultCenter] removeObserver:self]; [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications]; [super dealloc]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload