iosswiftparsingswift2pfobject

Swift 2 syntax for Parse fetchAllIfNeededInBackground


What is the syntax for PFObject's fetchAllIfNeededInBackground (with block) in Swift2.

The objective-c signature is:

+ (void)fetchAllIfNeededInBackground:(nullable NSArray<PFObject *> *)objects block:(nullable PFArrayResultBlock)block;

Parse PFObject Documentation

Can someone write a quick example that compiles in Swift 2?


Solution

  • Auto-complete should fill it for you, if not, have you tried something like

    PFObject.fetchAllIfNeededInBackground(<objects>) { (results: [AnyObject]?, error: NSError?) -> Void in
    
        }