Skip to content

版本兼容助手,获取本次启动或者上次启动时float类型的版本号,检测本次启动是升级还是初次安装。 Version compatibility assistant. When you launch, check whether this startup is an upgrade or initial installation,.and, you can get the version number size of the float type.

License

Notifications You must be signed in to change notification settings

BeijingiOSDeveloper/XYWAppVersionHelper

 
 

Repository files navigation

XYWAppVersionHelper

处理一些版本升级兼容问题时用到。你可以更改targets中的Version来测试。理论来讲只需要用到appThislaunchType方法,根据返回值来做相应的操作。 ⚠️注意,仅支持最多3段数字类型的版本号,且第二段不大于100(eg,1、3.0、5.1.5、10.88.666)

使用场景

  1. 应用版本兼容问题
  2. 启动广告显示
  3. 版本升级

使用方法

  1. 直接下载拖入文件夹到工程
  2. 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;
}

About

版本兼容助手,获取本次启动或者上次启动时float类型的版本号,检测本次启动是升级还是初次安装。 Version compatibility assistant. When you launch, check whether this startup is an upgrade or initial installation,.and, you can get the version number size of the float type.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 54.3%
  • Ruby 45.7%