iosswiftparse-platformbolts-framework

Bolts async framework methods not recognized


In my swift iOS app I installed the bolts framework, and in the bridging header file I got this

#import <FacebookSDK/FacebookSDK.h>
#import <Parse/Parse.h>
#import <ParseFacebookUtils/PFFacebookUtils.h>
#import <Bolts/Bolts.h>

So it's supposed to work. However, I can't get access to any methods from this framework, such as findAsync or continueWithSuccessBlock. They are not recognized. Am I missing the point ? How to have bolts method frameworks recognized ?


Solution

  • I randomly found that the syntax is different that all what is documented. Documentation states that to access BFTask on query, you must type:

    var query = PFQuery(className:"Student")
    findAsync(query).continueWithSuccessBlock
    

    Well it turns out that "findAsync" does not exist on my version ?! Instead, I can access it with:

    query.findObjectsinBackground()
    

    This returns a BFTask, and then I can access the other Bolts code such as continueWithBlock.