处理一些版本升级兼容问题时用到。你可以更改targets中的Version来测试。理论来讲只需要用到appThislaunchType方法,根据返回值来做相应的操作。
- 应用版本兼容问题
- 启动广告显示
- 版本升级
- 直接下载拖入文件夹到工程
- cocapods 添加
pod 'XYWAppVersionHelper'
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
XYWVersonHelperLunchType type = [XYWAppVersionHelper shareHelper].lunchType;
switch (type) {
case XYWVersonHelperLunchTypeNormal:
NSLog(@"正常启动");
break;
case XYWVersonHelperLunchTypeFirstLuchThisVersion:
NSLog(@"新版本启动");
break;
case XYWVersonHelperLunchTypeFirstLuchAfterInstall:
NSLog(@"安装后第一次启动");
break;
default:
break;
}
NSLog(@"上次启动时的版本号%f",[XYWAppVersionHelper shareHelper].currentVersion);
NSLog(@"当前版本号%f",[XYWAppVersionHelper shareHelper].currentVersion);
return YES;
}