no

Trigger event on first launch in xcode

Open AppDelegate.swift and modify this line: func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NS...

Open AppDelegate.swift and modify this line:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {
    return true
}
to
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {

 if (NSUserDefaults.standardUserDefaults().boolForKey("HasLaunchedOnce")){
  //app already launched 
  println("app already launched") 
 }else{
  NSUserDefaults.standardUserDefaults().setBool(true, forKey: "HasLaunchedOnce")
  NSUserDefaults.standardUserDefaults().synchronize()
  //This is the first launch ever
 
  println("this is the first launch ever")
 }

 return true
}

Related

xcode 1538420662088862974

Post a Comment Default Comments

Outsourcing

Are you looking for freelancers in the Philippines? Get in touch.

Donations

If you like what I do, you can support this channel by buying me a coffee. I would be grateful for your contribution! Your donations will help me create more FREE online courses and learning materials for programmers and remote workers.

item