Closed khoanguyen-3fc closed 8 years ago
By listening to METDDPClientDidChangeConnectionStatusNotification and setting everything up there:
NSNotificationCenter.defaultCenter().addObserver(self, selector: "connectionChanged", name: METDDPClientDidChangeConnectionStatusNotification, object: getMeteor())
func connectionChanged() { if getMeteor().connected { ... } }
I'd encounter a problem when show user data on initial view load (user logged in), as I see the problem is user data fetch before app connected to DDP server.
My question is how to ensure app connected to DDP server before AppDelegate application:didFinishLaunchingWithOptions return?
Here is my code:
AppDelegate:
Output of console: