确定外观屏幕iOS [英] Decide Appearance Screen iOS

查看:169
本文介绍了确定外观屏幕iOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请参考下面的图片:

我想在"VIEW 1"屏幕或"VIEW 2"屏幕上直接启动应用程序,而没有"START"屏幕的可视外观,该外观决定了要显示的VIEW屏幕.

I want to start app 'directly' on "VIEW 1" screen or "VIEW 2" screen, without visual appearance of "START" screen which decide VIEW screen to display.

    Eg.  in loadView() of STARTviewcontroller.m 

 if (some condition)
    {
    call "VIEW 1" screen
    }
    else
    {
    call "VIEW 2" screen
    } 

这是最好的方法吗? 我应该使用segue/[self presentViewController:...] ??

Is this best way to do it ? what should i use segue / [self presentViewController: ...] ??

推荐答案

做一件事.

在情节提要中将" View1 "控制器设置为初始视图控制器.

Set "View1" controller as initial view controller in your storyboard.

现在,在您的 AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.

    BOOL showSecondViewController = YES;
    UIStoryboard *mainStoryBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];

    if (showSecondViewController) {

        ViewController2 *objSecondViewController = [mainStoryBoard instantiateViewControllerWithIdentifier:@"ViewController2"];
        self.window.rootViewController = objSecondViewController;
        [self.window makeKeyAndVisible];


    } else {

        // It will show First view controller
    }
    return YES;
}

希望有帮助!

这篇关于确定外观屏幕iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆