Created
October 19, 2018 18:10
-
-
Save alansvits/809287b6e3cc546245a618bf53566d70 to your computer and use it in GitHub Desktop.
How to detect first time app launch on an iPhone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func isAppAlreadyLaunchedOnce()->Bool{ | |
let defaults = UserDefaults.standard | |
if let isAppAlreadyLaunchedOnce = defaults.string(forKey: "isAppAlreadyLaunchedOnce"){ | |
print("App already launched : \(isAppAlreadyLaunchedOnce)") | |
return true | |
}else{ | |
defaults.set(true, forKey: "isAppAlreadyLaunchedOnce") | |
print("App launched first time") | |
return false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source https://stackoverflow.com/questions/9964371/how-to-detect-first-time-app-launch-on-an-iphone