Skip to content

Instantly share code, notes, and snippets.

@Ravi61
Last active October 6, 2017 12:35
Show Gist options
  • Save Ravi61/802f48de4c0d5e7f75451940113aa862 to your computer and use it in GitHub Desktop.
Save Ravi61/802f48de4c0d5e7f75451940113aa862 to your computer and use it in GitHub Desktop.
Code for LocationAppDelegate
class LocationAppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]? = nil) -> Bool {
// initialize location manager
return true
}
func applicationWillEnterForeground(_ application: UIApplication) {
// start tracking
}
func applicationDidEnterBackground(_ application: UIApplication) {
// stop tracking
}
func applicationDidBecomeActive(_ application: UIApplication) {
// some location related code
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment