TheYiOS / Chinese-Brushes

1 stars 0 forks source link

the new draw #1

Open guodongZhao opened 8 years ago

guodongZhao commented 8 years ago
guodongZhao commented 8 years ago

// 版本号

define bundleID [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];

// 判断第一次使用(升级也算第一次使用)
// 存放的BOOL只为NO,证明第一次使用app
if (![[NSUserDefaults standardUserDefaults] boolForKey:bundleID]) {
    NSLog(@"加载引导页");
    UIStoryboard *st = [UIStoryboard storyboardWithName:@"welcome" bundle:nil];
    self.window.rootViewController = st.instantiateInitialViewController;        
}
else {
    NSLog(@"直接进入应用");
    UIStoryboard *st = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    self.window.rootViewController = st.instantiateInitialViewController;
}

[self.window makeKeyAndVisible];

return YES;