Skip to content

Instantly share code, notes, and snippets.

@ericcgu
Last active August 29, 2015 14:15
Show Gist options
  • Save ericcgu/4f50d9bc33f239f0ae55 to your computer and use it in GitHub Desktop.
Save ericcgu/4f50d9bc33f239f0ae55 to your computer and use it in GitHub Desktop.
ParseUI Hack
override func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!, object: PFObject!) -> JPUserTableViewCell! {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as JPUserTableViewCell
cell.imageView.hidden = true
(cell.viewWithTag(1) as PFImageView).image = kProfileDefaultProfileImage
dispatch_async(dispatch_get_main_queue(),{
//cell.textLabel?.text = object["username"] as? String
if let profileImageData = object["profileImage"] as? PFFile {
println(profileImageData)
cell.imageView.file = profileImageData
(cell.viewWithTag(1) as PFImageView).file = cell.imageView.file
}
else {
(cell.viewWithTag(1) as PFImageView).image = kProfileDefaultProfileImage
}
});
//cell.updateConstraints()
return cell
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment