parse.com - Parse Cloud Code: Retrieve Image Data For iOS App -
i'm writing ios app parse backend, , amongst other things list blog entries.
each blog entry has associated image, don't want fetch image object each entry , have fetch image file each of those. wrote cloud function combine 2 steps , return raw image data single request.
here's cloud code:
var imagefile = image.get("photofile"); parse.cloud.httprequest({ url: imagefile.url() }).then(function(dataresponse){ response.success(dataresponse.buffer); }); when this, array of integers, , don't know go here uiimage. here's ios code have far:
pfcloud.callfunctioninbackground(latestimagecloudfunctionname, withparameters: parameters) { (imagedata, error) -> void in if let data = imagedata { //imagedata of type [int] } } is image base64 encoded here? how nsdata object create uiimage?
Comments
Post a Comment