- (void)startRootViewController {
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
if (![[NSUserDefaults standardUserDefaults] boolForKey:@"isNotFirstInit"]) {
//第一次启动引导页面
NSLog(@"wanggsx:第一次启动");
UIStoryboard *FisrtInitRouter =[UIStoryboard storyboardWithName:@"FisrtInitRouter" bundle:[NSBundle mainBundle]];
UINavigationController *rootVC =[FisrtInitRouter instantiateViewControllerWithIdentifier:@"FisrtInitRouter"];
self.window.rootViewController = rootVC;
// [self.window addSubview:rootVC.view];
}
else
{
//打开选择主页
[self switchRootViewController];
}
[self.window makeKeyAndVisible];
}
//切换RootViewController
- (void)switchRootViewController
{
UIStoryboard *main =[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
UITabBarController *rootVC =[main instantiateViewControllerWithIdentifier:@"MotoTabBarViewController"];
self.window.rootViewController = rootVC;
}
引导完成点击的按钮
- (IBAction)startExperience:(UIButton *)sender {
// [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"firstLaunch"];
AppDelegate *appDelegate=[UIApplication sharedApplication].delegate;
[appDelegate switchRootViewController];
}
3112

被折叠的 条评论
为什么被折叠?



