0

I'm not using Auto Layout because I prefer to work with each device separately without those constraints. I have a separate storyboard for iPhone 5 and another for iPhone 6. I got the correct code in AppDelegate.m because on simulator the iPhone 5 storyboard loads on iPhone 5 simulator and iPhone 6 storyboard loads on iPhone6 simulator. On device, iPhone 5 storyboard loads on iPhone 5 device and iPhone 5 storyboards loads on iPhone 6 device but a zoomed version.

I used the following in code in application didFinishLaunchingWithOptions in AppDelegate.m...

CGSize iosScreenSize = [[UIScreen mainScreen] bounds].size;

if (iosScreenSize.height ==667) {

 UIStoryboard *iPhone6 =[UIStoryboard storyboardWithName:@"iPhone6" bundle:nil];

 UIViewController *initialViewController =[iPhone6 instantiateInitialViewController];

 self.window.rootViewController = initialViewController;

 [self.window makeKeyAndVisible];
 } 

Why is the simulator loading the correct storyboard for iPhone 6 but the device loads the wrong storyboard, how can that even be??

HELLO
  • 497
  • 2
  • 7
  • 17
  • It must work since when I comment this code, on iPhone 6 simulator, I receive a zoomed version of iPhone 5 storyboard. When I uncomment this code, I receive iPhone 5 storyboard on iPhone 5 and iPhone 6 storyboard on iPhone 6. But this is all in simulator. – HELLO Feb 09 '16 at 18:52
  • Try deleting the app on the real device and reinstalling it. – LinusGeffarth Feb 09 '16 at 18:54
  • I did that too. That changes nothing. – HELLO Feb 09 '16 at 18:54

1 Answers1

0

Check the iphone model not the height in if condition This may help you. iOS How to detect iPhone 6 plus, iPhone 6, iPhone 5 by macro?

Community
  • 1
  • 1