Skip to content

Instantly share code, notes, and snippets.

@indyfromoz
Created May 26, 2013 22:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save indyfromoz/5654297 to your computer and use it in GitHub Desktop.
Save indyfromoz/5654297 to your computer and use it in GitHub Desktop.
Separate storyboard for iPhone 5
CGSize iOSDeviceScreenSize = [[UIScreen mainScreen] bounds].size;
if (iOSDeviceScreenSize.height == 480){
UIStoryboard *iPhone35Storyboard = [UIStoryboard storyboardWithName:@"Storyboard_iPhone4" bundle:nil];
UIViewController *initialViewController = [iPhone35Storyboard instantiateInitialViewController];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = initialViewController;
}
if (iOSDeviceScreenSize.height == 568){ // iPhone 5
UIStoryboard *iPhone4Storyboard = [UIStoryboard storyboardWithName:@"Storyboard_iPhone5" bundle:nil];
UIViewController *initialViewController = [iPhone4Storyboard instantiateInitialViewController];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = initialViewController;
}
[self.window makeKeyAndVisible];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment