Both on the iPhone simulator and on the iPhone 3GS (iOS 6), I canāt set the portrait orientation upside down. I have only one ViewController. I added this code to it:
-(BOOL) shouldAutorotate{ return YES; } -(UIInterfaceOrientation) preferredInterfaceOrientationForPresentation{ return UIInterfaceOrientationPortraitUpsideDown; } - (NSUInteger)supportedInterfaceOrientations{ return UIInterfaceOrientationPortrait | UIInterfaceOrientationPortraitUpsideDown; } -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{ if (toInterfaceOrientation==UIInterfaceOrientationPortrait || toInterfaceOrientation==UIInterfaceOrientationPortraitUpsideDown) { return YES; } return NO; }
I also added this to AppDelegate.m:
-(NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{ return UIInterfaceOrientationPortrait | UIInterfaceOrientationPortraitUpsideDown; }
I also checked the plist file, both orientations are present there. On my storyboard, the Modeled Orientation Metric is set to Inferred. I am not doing anything in my DidFinishLaunchingWithOptions application, with the exception of returning YES. I just added a UIImageView inside this ViewController. Is this orientation possible?
source share