IOS启动时判断登录与否

Storyboard转向

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{        
    BOOL isLoggedIn = ...;    // from your server response
 
    NSString *segueId = isLoggedIn ? @"MainIdentifier" : @"LoginIdentifier";
    self.window.rootViewController = [self.window.rootViewController.storyboard instantiateViewControllerWithIdentifier:segueId];
 
    return YES;}

猜你喜欢

转载自lizhuang.iteye.com/blog/2147739