- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//1.创建窗口
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
//2.判断是否第一次使用软件当前版本
NSString *key = (NSString *)kCFBundleVersionKey;
//2.1先去沙盒中取出上次使用的版本号
NSString *lastVersionCode = [[NSUserDefaults standardUserDefaults] objectForKey:key];
//2.2加载程序中info.plist文件(获得当前软件版本号)
NSString *currentVersioncode = [NSBundle mainBundle].infoDictionary[key];
if ([lastVersionCode isEqualToString:currentVersioncode]) {
//非第一次使用
[self startWare :NO];
} else {
//第一次使用软件
//2.3.保存当期软件版本号
[[NSUserDefaults standardUserDefaults] setObject:currentVersioncode forKey:key];
[[NSUserDefaults standardUserDefaults] synchronize];
//2.4.新特性控制器
NewFeatureViewController *new = [[NewFeatureViewController alloc] init];
new.startBlock = ^(BOOL shared){
[self startWare:shared];
};
self.window.rootViewController = new;
}
// NSLog(@”%@”,currentVersioncode);
//3.显示窗口
[self.window makeKeyAndVisible];
return YES;
}
显示软件新特性
最新推荐文章于 2022-11-17 15:22:23 发布