AppVersioMoitor是一款为方便监控iOS应用程序版本的软件。
通过它你可以获得以往的版本和安装历史。
使用:运行工程实例,克隆repo,并且先从实例项目运行podistall。
要求:iOS8.0+
SematicVersioig
安装:AppVersioMoitor可在CocoaPods上使用。要安装AppVersioMoitor你只需要在Podfile中按照下面的操作即可:
pod "AppVersioMoitor"使用:安装:// AppDelegatefuc applicatioDidFiishLauchig(applicatio: UIApplicatio) { AppVersioMoitor.sharedMoitor.startup()}获得MarketigVersio(CFBudleShortVersioStrig):let curretVersio: AppVersio = AppVersio.marketigVersiolet versioStrig: Strig = AppVersio.marketigVersio.versioStrig // "1.2.3"获得安装过的版本:let istalledVersios: [AppVersio] = AppVersioMoitor.sharedMoitor.istalledVersios对比版本:AppVersio.marketigVersio > AppVersio("1.2.3")AppVersio("1.2.3") < AppVersio("3.2.1")AppVersio("1.2.3") < "3.2.1"更方便地检测自己当前的版本状况:switch AppVersioMoitor.sharedMoitor.state {case .Istalled:// Do somethig whe app istalled.// Happy! // ex. Start tutorial.case .NotChaged:// Do somethig whe versio ot chaged.// Peace // Nothig to do?case .Upgraded(let previousVersio: AppVersio):// Do somethig whe versio upgraded.// Yeah! // ex. Migrate App Data.case .Dowgraded(let previousVersio: AppVersio):// Do somethig whe versio dowgraded. (Impossible ormally)// What happeed? // ex. Purge App Data.}









评论