I'm trying to fetch an image from parse which is similar to this problem
iOS - Retrieve and display an image from Parse in UIImageView (Swift 1.2 Error)
func fetchDataEmployer(){
self.companyNameLabel.text = (PFUser.currentUser()?.objectForKey("companyName")?.capitalizedString)! as String
//MARK: - FETCHING IMAGE FILE FROM PARSE
if let companyImage = PFUser.currentUser()?["profileImageEmployer"] as? PFFile {
companyImage.getDataInBackgroundWithBlock({ ( imageData: NSData?, error: NSError?) -> Void in
if error == nil{
self.profileEmployerImage.image = UIImage(data: imageData!)
} else {
print("No image found")
}
})
}
}
It keep returning nil