ios - How to separate functions accessing Parse.com into a separate class? -
i have function (using function example only, question parse accesses) below need call several different uiviewcontroller
classes.
i hoping put function in separate class can instantiate in multiple uiviewcontroller
classes , call function.
since saveinbackgroundwithblock
asynchronous process, how can return scoreagain
object uiviewcontroller class.
is possible?
var query = pfquery(classname: "gamescore") query.getobjectinbackgroundwithid(gamescore.objectid) { (scoreagain: pfobject!, error: nserror!) -> void in if !error { nslog("%@", scoreagain.objectforkey("playername") nsstring) } else { nslog("%@", error) } }
the goal here separate cloud end accesses separate classes because if change backend parse.com
else in future, dont have touch uiviewcontroller
classes change helper classes.
Comments
Post a Comment