Skip to content

Instantly share code, notes, and snippets.

@justinmakaila
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save justinmakaila/772f7b31a0b6d643b1dd to your computer and use it in GitHub Desktop.

Select an option

Save justinmakaila/772f7b31a0b6d643b1dd to your computer and use it in GitHub Desktop.
Parse User Bug
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