user6520705 user6520705 - 1 year ago 234
iOS Question

Parse Xcode 8 and swift 3 CompletianHandler error

I updated to xcode 8 and my code was updated to swift 3. Now i get errors wherever i used blocks inside my code with Parse. Here is one example

query.findObjectsInBackground { (objects:[PFObject]?, error:NSError?)' in

this gives the error cannot convert value of type '([PFObject]?, NSError?) ->()
to expected argument type '([PFObject]?, Error?) -> Void?'

Answer Source

Try this:

query.findObjectsInBackground { (objects:[PFObject]?, error:Error?)' in

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download