I'm trying to get the data of an image but I'm getting this error:
Cannot convert value of type 'Data?' to expected argument type 'UIImage'
The code:
if let image = profileImageView.image {
if let imageData = UIImagePNGRepresentation(image.pngData()) {
PFUser.current()?["photo"] = PFFileObject(name: "profile.png", data: imageData)
}
}
Where have I gone wrong?