-
-
Notifications
You must be signed in to change notification settings - Fork 872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dispatch_once_t is unavailable in Swift 3 #1056
Comments
Actually looking through the previous releases I found that in the Parse SDK 1.14.0 all subclasses are registered automatically https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/releases/tag/1.14.0 So we don't need to do the call inside AppDelegate to .registerSubClass and coincidentally we don't need to do the call inside the SubClass via the initialize method above, which means we don't need to use the dispatch_once method to make sure it's only ever registered once, removing the Swift 3 code compatibility issue. So problem solved. Closing this issue, please re-open if needed. |
Turns out you still need to register the subClass in AppDelegate otherwise it cannot identify your class.
|
Final problem I had was not storing PFUser.currentUser() in between close/reopen, thought it was due to removing initialize but not the case thank god. Just have to enable KeyChain Sharing in your app capabilities. |
Hi, now dispatch_once_t is unavailable in Swift 3 how would you recommend replacing it?
XCode suggests using lazily initialized globals, what would be a recommended replacement?
Now looking at this post http://stackoverflow.com/questions/33069650/parse-com-subclassing-in-swift-2 it suggests registering the SubClass within AppDelegate:
So if I register the subclass in AppDelegate do I even need to include the initialize block inside the subclass? removing the problem with dispatch_once.
What do you think or is this crazy?
Appreciate it,
The text was updated successfully, but these errors were encountered: