Wenn Sie AutoLayout verwenden, sind für jedes Gerät keine separaten Storyboards erforderlich. AutoLayout verwaltet alle Dinge für Sie, wenn Sie geeignete Einschränkungen und Größenklassen bereitstellen.
Wenn Sie wirklich eine separate Storyboards für jedes Gerät müssen so hier ist die Lösung:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
UIViewController *initialViewController = nil;
UIStoryboard *storyboard;
if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone)
{
CGSize iOSDeviceScreenSize = [[UIScreen mainScreen] bounds].size;
if (iOSDeviceScreenSize.height == 667)
{
storyboard = [UIStoryboard storyboardWithName:@"6board" bundle:nil];
initialViewController = [storyboard instantiateInitialViewController];
}else if (iOSDeviceScreenSize.height == 736){
storyboard = [UIStoryboard storyboardWithName:@"6plus" bundle:nil];
initialViewController = [storyboard instantiateInitialViewController];
}else{
storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
initialViewController = [storyboard instantiateInitialViewController];
}
}else{
storyboard = [UIStoryboard storyboardWithName:@"ipadboard" bundle:nil];
initialViewController = [storyboard instantiateInitialViewController];
}
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[self.window makeKeyAndVisible];
self.window.rootViewController = initialViewController;
hoffen, dass es Ihnen geholfen ... Happy Codding
bitte Tag, die Sprache, die Sie verwenden wie 'objective-c' oder 'swift' @Manzoor –