Skip to content

Instantly share code, notes, and snippets.

@olivaresf
Last active July 26, 2020 05:46
Show Gist options
  • Save olivaresf/01e7f2690bb661a797c1c604db6cf809 to your computer and use it in GitHub Desktop.
Save olivaresf/01e7f2690bb661a797c1c604db6cf809 to your computer and use it in GitHub Desktop.
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell",
for: indexPath as IndexPath) as! ContactCellTableViewCell
let contactsInSection = yourContacts[indexPath.section] as! NSArray
let contactForRow = contactsInSection[indexPath.row] as! APContact
cell.nameLabel.text = contactForRow.name?.compositeName ?? ""
cell.phoneLabel.text = contactForRow.phones?.first?.number
cell.emailLabel.text = contactForRow.emails?.first?.address
cell.contactImageView.image = contactForRow.thumbnail
return cell
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment