A very simple mechanism for tracking the number of times your app has been launched. Useful for running certain activities the very first time the app is launched, for example.
In your app delegate
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
}
To run the example project, clone the repo, and run pod install
from the Example directory first.
LaunchCounter is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'LaunchCounter'
megatron1000, [email protected]
LaunchCounter is available under the MIT license. See the LICENSE file for more info.
link |
Stars: 2 |
Last commit: 2 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics