How can I detect the very first time launch of
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// if very first launch than perform actionA
// else perform actionB
}
method?
How can I detect the very first time launch of
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// if very first launch than perform actionA
// else perform actionB
}
method?
for swift 3.0
add extension
then in your code
You need to save something when you launch and then check to see if it exists. If not, it's the first time. "Something" can be a file, a database entry, a setting in user defaults....
For Swift 2.0 in Xcode 7. In the AppDelegate.swift file:
Quick and easy function
store a bool key in NSUserDefaults first time it will be no you will change it to yes and keep it like that until the app delete or reinstall it will be again tha first time.