Skip to content

simplisticated/Start

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Start

At a Glance

Start is a tool that handles different things occurring on app launch.

How To Get Started

  • Copy content of Source folder to your project.

or

  • Use Start cocoapod

Requirements

  • iOS 9 and later
  • Xcode 9 and later
  • Swift 4

Usage

Launch count

In your AppDelegate, increment the number of launches stored by Start library:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    // ...
    
    Start.launches.increment()
    
    // ...
    
    return true
}

Now you can retrieve number of app's launches:

let launchCount = Start.launches.count

It's very easy to check if the app is launched for the first time:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    // ...
    
    Start.launches.increment()
    
    // ...
    
    switch Start.launches.count {
    case 1:
        // The first launch
        break
    default:
        // Not the first launch
        break
    }
    
    // ...
    
    return true
}

Sometimes you might need to reset the number of launches:

Start.launches.reset()

License

Start is available under the Apache 2.0 license. See the LICENSE file for more info.

About

App launch handler for iOS

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published