JAVA
// Prepare Filebyte[] photoBytes = myPhotoObject.toByteArray();
ParseFile photo = new ParseFile("myPicture.jpg", photoBytes);
photo.saveInBackground();
// Now save to Parse Table
ParseObject myParseTable = new ParseObject("MyParseTable");
myParseTable.put("ID", "1");
myParseTable.put("Photo", photo);
myParseTable.saveInBackground();
SWIFT
// Prepare Filelet imageData = UIImagePNGRepresentation(image)
let photo= PFFile(name:"myPicture.jpg", data:imageData)
// Now save to Parse Table
var myParseTable = PFObject(className:"MyParseTable")
myParseTable["ID"] = "1"
myParseTable["Photo"] = photo
myParseTable.saveInBackground()
No comments:
Post a Comment