Mason Ballowe
Mason Ballowe

Reputation: 1866

Convery my UIImageView to a PFFile in SWIFT

I have a UIImageView in my storyboard, and the user can successfully select an image from their phone to place in the ImageView; however, I'm not sure how to get that from the storyboard to Parse.com.

Any code would be much appreciated. There are lots of tutorials on downloading, but not saving initially.

Upvotes: 1

Views: 997

Answers (1)

Schemetrical
Schemetrical

Reputation: 5536

You need to take the image out of the UIImageView and sage it to a PFFile.

var file = PFFile(data: UIImageJPEGRepresentation(imageView.image, 1.0))

Then of course, you can upload the file somewhere you choose.

Upvotes: 5

Related Questions