2

I have a method in my AppDelegate file. Which I was calling from another class. But after implementing Localytics I am getting a crash. Here is how I was calling the method.

 let delegate = UIApplicatin.shared.delegate as ! AppDelegate
 delegate.myFunction()

I have tried this answer from Stack Overflow. Its does not crash the app but method is not called.

Community
  • 1
  • 1

1 Answers1

1

Got it working. Actually I was missing the line in didFinishLauncihingWithOptions as mentioned in This answer. We have to do this.

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        AppDelegate.originalAppDelegate = self
    }
Community
  • 1
  • 1