2

Here is my code:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    return true
}

I am reading through tutorials for local push notifications for my iOS app and this function comes up a lot however when implementing it in my project I get this error:

Invalid redeclaration of 'application(_:didFinishLaunchingWithOptions:)'

My question is why am I getting this error and what is the correct function to replace it with?

I read the documentation in Xcode and it is telling that is function exists which is why I am confused.

Jigar Tarsariya
  • 3,189
  • 3
  • 14
  • 38
AtomProgrammer
  • 327
  • 2
  • 13

1 Answers1

7

You need not to declare this function it is available out of the box in your app delegate file. In app delegate this is the first function available Use it to put your logic.

Jeet
  • 5,569
  • 8
  • 43
  • 75