Reputation: 23
I tried to get image info for UIImage and then put them it through PFFile. But there is the below error on Xcode.
"Cannot convert value of type '(CGFloat) -> Data?' to expected argument type 'Data'"
let imageData = UIImage.jpegData(imageView.image!)
let file = PFFile(name: "320.jpg", data: imageData)
The error message is
"Cannot convert value of type '(CGFloat) -> Data?' to expected argument type 'Data'"
Upvotes: 1
Views: 757
Reputation: 1679
Try this
let image = UIImage(named: "320.jpg")
let file = PFFile(data: image.jpegData(compressionQuality: 1.0))
Upvotes: 2