iOS7 iPad Landscape only app, using UIImagePickerController

If your iPad app is landscape only in all conditions, just do these 3 steps : 1) In your app delegate – (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { return UIInterfaceOrientationMaskAll; } 2) Create a category header #import “UIViewController+OrientationFix.h” @implementation UIViewController (OrientationFix) – (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { return UIInterfaceOrientationIsLandscape(toInterfaceOrientation); } – (BOOL)shouldAutorotate { return YES; } – (NSUInteger)supportedInterfaceOrientations { … Read more

iOS: Device orientation on load

EDIT: I mis-read your question. This will allow you to start your application in certain orientations. Just realized you’re trying to figure out the orientation on launch. There is a method to check the status bar orientation on UIApplication: [[UIApplication sharedApplication] statusBarOrientation]; Original answer Try setting the application’s accepted device orientations in the plist file: … Read more

RootViewController animation transition, initial orientation is wrong

I looked into this just now because I kept getting the same issue. I randomly tried the following, and it worked perfectly: [UIView transitionWithView:window duration:0.5 options:UIViewAnimationOptionTransitionCrossDissolve animations:^(void) { BOOL oldState = [UIView areAnimationsEnabled]; [UIView setAnimationsEnabled:NO]; [(ICApp *)sharedApplication.delegate window].rootViewController = self; [UIView setAnimationsEnabled:oldState]; } completion:nil]; I know it’s a bit odd to disable/enable animations inside an … Read more

How to change the device orientation programmatically in iOS 6 [duplicate]

Here are my “five cents”, tested on iOS7 with ARC [[UIDevice currentDevice] setValue: [NSNumber numberWithInteger: UIInterfaceOrientationPortrait] forKey:@”orientation”]; This doesnt generate “leak” warning as performSelector will. UIAlertView – with this code, when you open UIAlertView during view(will/Did)appear you will notice that all but this view is in portrait (apple, really?) I wasn’t able to force the … Read more

Is [UIScreen mainScreen].bounds.size becoming orientation-dependent in iOS8?

Yes, it’s orientation-dependent in iOS8, not a bug. You could review session 214 from WWDC 2014 for more info: “View Controller Advancements in iOS 8” Quote from the presentation: UIScreen is now interface oriented: [UIScreen bounds] now interface-oriented [UIScreen applicationFrame] now interface-oriented Status bar frame notifications are interface-oriented Keyboard frame notifications are interface-oriented

tech