Skip to content

Instantly share code, notes, and snippets.

@olivaresf
Created July 26, 2020 05:02
Show Gist options
  • Save olivaresf/0e50515e1a7c6436855b35134bade745 to your computer and use it in GitHub Desktop.
Save olivaresf/0e50515e1a7c6436855b35134bade745 to your computer and use it in GitHub Desktop.
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell:ContactCellTableViewCell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as ContactCellTableViewCell
if(yourContacts.count > 0){
let contact = yourContacts[indexPath.section][indexPath.row] as APContact
cell.nameLabel.text = contact.compositeName != nil ? contact.compositeName : ""
cell.phoneLabel.text = contact.phones.count > 0 ? contact.phones[0] as String : ""
cell.emailLabel.text = contact.emails.count > 0 ? contact.emails[0] as String : ""
//IMAGE:
//RESIZING DONE IN CUSTOM TABLE CELL !!!!
//cell.contactImageView.frame = CGRectMake(0, 0, 75, 75)
if (contact.thumbnail != nil){
cell.contactImageView.image = contact.thumbnail
}else{
cell.contactImageView.image = UIImage(named: "dummy")
}
}
return cell
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment