Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS 6 Rotation: Pushing a View Controller
    text
    copied!<p>I want to support iOS 6 rotation. Trouble is, I've been looking through a lot of documentation and stack overflow questions but have not found any even slightly in depth solutions. I've only seen that I should add these two methods to my view controller classes - however, if I'm not mistaken, they do not operate in the same way as the pre iOS 6 methods:</p> <pre><code>- (BOOL)shouldAutorotate { return YES; } - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskAll; // use what is appropriate for you. } </code></pre> <p>My app currently rotates in pre-iOS6 using the following code. Note that I use the interface orientation parameters to determine whether or not I'm going to push my view Controller. How do I implement this in the iOS 6 rotation delegates?</p> <pre><code>-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { UIInterfaceOrientation toOrientation = self.interfaceOrientation; if ( self.tabBarController.view.subviews.count &gt;= 2 ) { UIView *tabBar = [self.tabBarController.view.subviews objectAtIndex:1]; if(toOrientation != UIInterfaceOrientationLandscapeLeft &amp;&amp; toOrientation != UIInterfaceOrientationLandscapeRight) { CUSTOM_DEBUG_LOG("\n\nRotated back to Portrait"); tabBar.hidden = FALSE; } } } - (void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration { if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight) { CUSTOM_DEBUG_LOG("\nView going landscape"); ScrollViewController *s = [[ScrollViewController alloc] initWithNibName:@"ScrollViewController" bundle:nil]; [self.navigationController pushViewController:s animated:NO]; [s release]; self.tabBarController.tabBar.hidden = YES; self.navigationController.navigationBar.hidden = YES; } } </code></pre>
 

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