objective c - Changing storyboard depending on iOS screensize not working -


I'm not a big fan of XCode 6's new hurdle system, so I create my own storyboard for each iPhone size , But it does not work 100%, it works with iPhone 4 and iPhone 5, but when it tests on iPhone 6 or iPhone 6+, it shows the iPhone 5 storyboard. Example: I am using the iPhone 4 simulator, my label is called '4' on that storyboard.

Then I run an iPhone 5 simulator, which says my label '5' on that storyboard.

Then, I have the iPhone 6 and 6+ simulator, and it shows the same label as the iPhone 5 storyboard (this is showing the wrong storyboard)

I was thinking Can you please tell me what is wrong, I appreciate it!

> These are my storyboards:

And here is my code (inside my appgate.m file)

  - ( BOOL) Application :( UIApplication *) Application FinishLaunchingWithOptions: (NSDictionary *) Launch option {CGSize iOSScreenSize = [[UIScreen main screen] border]. Shape; If (iOSScreenSize.height == 480) {// iPhone 4 / 4S UIStoryboard * iPhone4 = [UIStoryboard storyboardWithName: @ "iPhone4" bundle: zero]; UIViewController * Initial ViewController = [iPhone4 instantiateInitialViewController]; Self.window = [[UIWindow alloc] initWithFrame: [[UIScreen main screen] border]]; Self.window.rootViewController = Initial view controller; [Self. Windows and knowledgeable]; } If (iOSScreenSize.height == 568) {// iPhone 5 / 5S UIStoryboard * iPhone5 = [UIStoryboard storyboardWithName: @ "iPhone5" bundle: zero]; UIViewController * Initial ViewController = [iPhone5 instantiateInitialViewController]; Self.window = [[UIWindow alloc] initWithFrame: [[UIScreen main screen] border]]; Self.window.rootViewController = Initial view controller; [Self. Windows and knowledgeable]; } If (iOSScreenSize.height == 667) {// iPhone 6 UIStoryboard * iPhone6 ​​= [UIStoryboard storyboardWithName: @ "iPhone6" bundle: zero]; UIViewController * Initial ViewController = [iPhone6 ​​instantiateInitialViewController]; Self.window = [[UIWindow alloc] initWithFrame: [[UIScreen main screen] border]]; Self.window.rootViewController = Initial view controller; [Self. Windows and knowledgeable]; } If (iOSScreenSize.height == 736) {// iPhone 6+ UIStoryboard * iPhone6Plus = [UIStoryboard storyboardWithName: @ "iPhone6 ​​+" bundle: zero]; UIViewController * initialViewController = [iPhone6Plus instantiateInitialViewController]; Self.window = [[UIWindow alloc] initWithFrame: [[UIScreen main screen] border]]; Self.window.rootViewController = Initial view controller; [Self. Windows and knowledgeable]; } Yes return; }  


Comments