LaunchCounter
描述
用于跟踪您的应用启动次数的一种非常简单机制。例如,在应用第一次启动时运行某些活动很有用。
示例
在您的应用程序代理中
let launchCounter = LaunchCounter()
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Record that the app was launched
launchCounter.trackLaunch()
if launchCounter.isFirstLaunch {
// Do something only on first launch
}
return true
}
要运行示例项目,请克隆仓库,然后先从示例目录中运行 pod install
。
安装
LaunchCounter 通过 CocoaPods 提供。要安装它,只需在 Podfile 中添加以下行
pod 'LaunchCounter'
作者
megatron1000, [email protected]
许可
LaunchCounter可在MIT许可证下使用。有关更多信息,请参阅LICENSE文件。