- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
if([userDefaults objectForKey:@"autoLogIn"] != nil && [userDefaults objectForKey:@"rand_code"] != nil) {
UIStoryboard *board = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
//获取故事板中某个View
UIViewController *next = [board instantiateViewControllerWithIdentifier:@"mainTabBar"];
[self.window setRootViewController:next];
[self.window makeKeyAndVisible];
}else{
UIStoryboard *board = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
//获取故事板中某个View
UIViewController *next = [board instantiateViewControllerWithIdentifier:@"mainTabBar"];
[self.window setRootViewController:next];
[self.window makeKeyAndVisible];
}
return YES;
}storyboard切换程序进入页面
最新推荐文章于 2020-10-14 10:06:55 发布
本文详细介绍了iOS应用在用户未登录时如何通过故事板引导用户完成登录流程,并在登录成功后展示主界面的逻辑过程。重点在于利用UIStoryboard进行界面切换,确保用户体验流畅。
1215

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



