Swiftpack.co - Megatron1000/LaunchCounter as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Megatron1000.
Megatron1000/LaunchCounter 0.4.0
Add a call to this class on app launch to increment the app launch count. Query it to find out if it's the first launch or get the specific number of launches.
⭐️ 2
🕓 2 years ago
iOS macOS tvOS
.package(url: "https://github.com/Megatron1000/LaunchCounter.git", from: "0.4.0")

LaunchCounter

CI Status Version License Platform

Description

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.

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.

Installation

LaunchCounter is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'LaunchCounter'

Author

megatron1000, [email protected]

License

LaunchCounter is available under the MIT license. See the LICENSE file for more info.

GitHub

link
Stars: 2
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

Query for first version and Launch Argument to Reset
2 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics