Get the applicationDidFinishLaunching call in the View Controller. Parse not yet initialized

I am trying to load data from Parse into my initial view controller. The problem is that Parse is initializing in my AppDelegate didFinishLaunching , so I need to wait until it is called before I try to load data from Parse. What is the best way to get this notification in my controller? Or would it be better to get the data in my AppDelegate ?

All help is appreciated!

0
source share
1 answer

You can add an observer for UIApplicationDidFinishLaunchingNotification inside your view controller's viewDidLoad method:

 NSNotificationCenter.defaultCenter().addObserver(self, selector: "yourMethod:", name: UIApplicationDidFinishLaunchingNotification, object: nil) 

Add your method to the view controller

 func yourMethod(notification: NSNotification?) { // your code } 
+1
source

Source: https://habr.com/ru/post/1241869/


All Articles