Last active
August 29, 2015 14:14
-
-
Save justinmakaila/772f7b31a0b6d643b1dd to your computer and use it in GitHub Desktop.
Parse User Bug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { | |
| configureParse(launchOptions) | |
| registerForUserNotifications() | |
| // If the current user is authenticated, show the home feed, else show onboarding. | |
| if let currentUser = PFUser.currentUser() { | |
| setHomeFeed() | |
| } else { | |
| setOnboarding() | |
| } | |
| return true | |
| } | |
| ... | |
| func configureParse(launchOptions: [NSObject: AnyObject]?) { | |
| // Configure Parse | |
| Parse.enableLocalDatastore() | |
| // Initialize Parse | |
| Parse.setApplicationId("MyApplicationKey", clientKey: "MyClientKey") | |
| // Track app opened event | |
| PFAnalytics.trackAppOpenedWithLaunchOptionsInBackground(launchOptions, block: nil) | |
| } | |
| // Console logs | |
| 2015-01-24 12:52:14.439 ScavengerHunt[5786:1619425] Warning: A long-running operation is being executed on the main thread. | |
| Break on warnBlockingOperationOnMainThread() to debug. | |
| 2015-01-24 12:52:14.457 ScavengerHunt[5786:1619425] Warning: A long-running operation is being executed on the main thread. | |
| Break on warnBlockingOperationOnMainThread() to debug. | |
| ^ The long running operations are due to `PFAnalytics.trackAppOpenedWithLaunchOptionsInBackground(...)` and `PFUser.currentUser()` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment