Unable to perform functions from Particle iOS Cloud SDK after downloading Xcode 8 / Swift 3.0 -
prior downloading xcode 8 able perform functions particle ios cloud sdk (spark sdk) without problem. now, being given multiple errors similar ones below.
sparkcloud.sharedinstance().loginwithuser(username!, password: password!) { (error:nserror?) -> void in // deactivates activity indicator. activityindicator.stopanimating() // reallows interaction events. uiapplication.sharedapplication().endignoringinteractionevents() if error != nil { utils.showalertonvc(self, title: "invalid parameters.", message: "please try again.") self.cleartext() } else { self.performseguewithidentifier("loginuser", sender: self) } }
error: cannot convert value of type '(nserror?) -> void' expected argument type 'sparkcompletionblock?'
sparkcloud.sharedinstance().getdevices { (sparkdevices: [anyobject]?, error: nserror?) -> void in if let sparkdevices = sparkdevices as? [sparkdevice] { device in sparkdevices { self.myphotons.append(device) self.tableview.reloaddata() } } }
error: cannot convert value of type '([anyobject]?, nserror?) -> void' expected argument type '(([any]?, error?) -> void)?'
i've tried updating podfile , toying function calls nothing seems work. i'm wondering if has updates in swift 3.0 can't find indicate so. issue appreciated.
instead of nserror
, use error
:
sparkcloud.sharedinstance().getdevices { (sparkdevices: [anyobject]?, error: error?)
this did trick me.
Comments
Post a Comment