3
This commit is contained in:
@@ -92,20 +92,25 @@
|
||||
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||
self.window.backgroundColor = [UIColor whiteColor];
|
||||
[self.window makeKeyAndVisible];
|
||||
BaseTabBarController *vc = [[BaseTabBarController alloc] init];
|
||||
self.window.rootViewController = vc;
|
||||
|
||||
// 根据当前是否已登录决定入口:有 token 进主 TabBar,否则先进入登录页
|
||||
BOOL loggedIn = [[KBUserSessionManager shared] isLoggedIn];
|
||||
UIViewController *rootVC = nil;
|
||||
if (loggedIn) {
|
||||
rootVC = [[BaseTabBarController alloc] init];
|
||||
} else {
|
||||
rootVC = [[KBLoginVC alloc] init];
|
||||
}
|
||||
self.window.rootViewController = rootVC;
|
||||
}
|
||||
|
||||
/// 首次安装时,展示性别选择页作为根控制器
|
||||
- (void)setupSexSelectRootVC {
|
||||
KBLoginVC *vc = [[KBLoginVC alloc] init];
|
||||
KBSexSelVC *vc = [[KBSexSelVC alloc] init];
|
||||
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||
self.window.backgroundColor = [UIColor whiteColor];
|
||||
[self.window makeKeyAndVisible];
|
||||
self.window.rootViewController = vc;
|
||||
|
||||
return;
|
||||
|
||||
KBSexSelVC *sexVC = [KBSexSelVC new];
|
||||
__weak typeof(self) weakSelf = self;
|
||||
sexVC.didFinishSelectBlock = ^{
|
||||
|
||||
Reference in New Issue
Block a user