Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/simplisticated/start

App launch handler for iOS
https://github.com/simplisticated/start

swift uiapplication uiapplicationdelegate xcode

Last synced: 1 day ago
JSON representation

App launch handler for iOS

Awesome Lists containing this project

README

        


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:

```swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// ...

Start.launches.increment()

// ...

return true
}
```

Now you can retrieve number of app's launches:

```swift
let launchCount = Start.launches.count
```

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

```swift
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:

```swift
Start.launches.reset()
```

## License

`Start` is available under the Apache 2.0 license. See the [LICENSE](./LICENSE) file for more info.