Note that there are some explanatory texts on larger screens.

plurals
  1. POUnderstanding iOS 6 Interface orientation change
    primarykey
    data
    text
    <p><strong>ADDED:</strong> I see that my question is viewed often without upvotes so I decided that you guys do not get what you search. Redirecting you to question that has really nice answer about <a href="https://stackoverflow.com/questions/12662240/how-to-make-app-fully-working-correctly-for-autorotation-in-ios-6">How to handle orientation changes in iOS6</a></p> <p>Specific demands to orientation changes: <a href="https://stackoverflow.com/questions/15947349/how-to-handle-different-orientations-in-ios-6">Restricted rotation</a></p> <p>Upvotes are welcome :)</p> <hr> <p>I've created a new project from Master Detail template and trying to start it with landscape orientation. As you know the </p> <p><code>- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation</code> </p> <p>method is deprecated and we must use </p> <p><code>- (NSUInteger)supportedInterfaceOrientations</code> </p> <p>and/or </p> <p><code>- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation</code></p> <p>Here's my code:</p> <pre><code>- (NSUInteger)supportedInterfaceOrientations { NSLog(@"supported called"); return UIInterfaceOrientationMaskAll;//Which is actually a default value } - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { NSLog(@" preferred called");//This method is never called. WHY? return UIInterfaceOrientationLandscapeRight; } </code></pre> <p>As you can see I'm trying to return landscape orientation in preferred method but it is never called. p.s. documentation states:</p> <blockquote> <p>Discussion The system calls this method when presenting the view controller full screen. You implement this method when your view controller supports two or more orientations but the content appears best in one of those orientations.</p> <p>If your view controller implements this method, then when presented, its view is shown in the preferred orientation (although it can later be rotated to another supported rotation). If you do not implement this method, the system presents the view controller using the current orientation of the status bar.</p> </blockquote> <p>So, the question is: Why the prefferredOrientation method is never get called? And how should we handle different orientations in different controllers?. Thanks! P.S don't mark the question as duplicate. I've investigated all similar questions and they do not have answer for mine.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    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