Last active
March 22, 2017 00:52
-
-
Save KirillKudaev/e204fac0b5ee13cf518e1f4f6c5ff576 to your computer and use it in GitHub Desktop.
Save 2 images to Parse. Swift.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let image1 = UIImage(named: "img1.jpg") | |
let data1 = UIImagePNGRepresentation(image1) | |
let file1 = PFFile(name: "img1", data: data1) | |
let image1 = UIImage(named: "img2.jpg") | |
let data2 = UIImagePNGRepresentation(image1) | |
let file2 = PFFile(name: "img2", data: data2) | |
let parseObj = PFObject(className: "testClass") | |
parseObj["text"] = "hello" | |
parseObj["image1"] = file1 | |
parseObj["image2"] = file2 | |
parseObj.saveInBackgroundWithBlock { | |
// some code here | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment