Skip to content

Instantly share code, notes, and snippets.

@olivaresf
Created July 26, 2020 05:16
Show Gist options
  • Save olivaresf/4aef48b9c25fba224661c27a23230ab8 to your computer and use it in GitHub Desktop.
Save olivaresf/4aef48b9c25fba224661c27a23230ab8 to your computer and use it in GitHub Desktop.
override func numberOfSections(in tableView: UITableView) -> Int {
guard yourContacts.count > 0 else { return 0 }
return UILocalizedIndexedCollation.current().sectionTitles.count
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
let contactsInSection = yourContacts.object(at: section) as! NSArray
return contactsInSection.count
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment