美文网首页
启动页加载出来有延迟现象

启动页加载出来有延迟现象

作者: summerTa | 来源:发表于2018-08-15 09:42 被阅读0次

启动页加载出来和tabbarcontroller比起来延缓了,这时要判断它是不是第一次启动,不是的话,就在另一个方法里面调用,不能放在同一个,否则就会有延迟,回调方法。

- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {

    // Override point for customization after application launch.

    if (![[NSUserDefaults standardUserDefaults]boolForKey:@"firstStart"]) {

        [[NSUserDefaults standardUserDefaults]setBool:YES forKey:@"firstStart"];

        //NSLog(@"程序第一次启动");

        guideViewController *guidview = [[guideViewController alloc]init];

        guidview.buttonClickBlock= ^(UIButton*btn) {

            JDTabBarController *jdtablebar = [[JDTabBarController alloc]init];

            jdtablebar.delegate=self;

            jdtablebar.selectedIndex=2;

            self.window.rootViewController= jdtablebar;

            [self.window makeKeyAndVisible];

        };

        self.window.rootViewController= guidview;

    }else{

       // NSLog(@"不是第一次启动");

        //NSLog(@"程序不是第一次启动");

        /*SCJumpViewController  *jmpView=[[SCJumpViewController alloc]init];

         jmpView.blockMainViewController = ^{

         JDTabBarController *jdtablebar = [[JDTabBarController alloc]init];

         jdtablebar.delegate = self;

         jdtablebar.selectedIndex = 2;

         self.window.rootViewController = jdtablebar;

         [self.window makeKeyAndVisible];

         };

         self.window.rootViewController = jmpView;*/

        SCJumpViewController *VC= [[SCJumpViewController alloc] init];

        //__weak typeof(VC) weakSelf = VC;

        VC.blockMainViewController = ^{

            [VC.viewremoveFromSuperview];

        };

        UIWindow *window = [UIApplication sharedApplication].keyWindow;

        [windowaddSubview:VC.view];

    }

相关文章

网友评论

      本文标题:启动页加载出来有延迟现象

      本文链接:https://www.haomeiwen.com/subject/fwsibftx.html