Skip to content

Instantly share code, notes, and snippets.

@olivaresf
Created July 26, 2020 05:09
Show Gist options
  • Save olivaresf/73c9702d1e48fee70fd6cde7b1cf3111 to your computer and use it in GitHub Desktop.
Save olivaresf/73c9702d1e48fee70fd6cde7b1cf3111 to your computer and use it in GitHub Desktop.
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
// #warning Potentially incomplete method implementation.
// Return the number of sections.
var numberOfSections = UILocalizedIndexedCollation.currentCollation().sectionTitles.count
//println("numberOfSections: \(numberOfSections)")
return numberOfSections
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete method implementation.
// Return the number of rows in the section.
return (yourContacts.count > 0) ? yourContacts.objectAtIndex(section).count : 0
}
/*override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
var showSection:Bool = yourContacts?.objectAtIndex(section).count != 0
//only show the section title if there are rows in the section
return (showSection) ? (UILocalizedIndexedCollation.currentCollation().sectionTitles[section] as String) : nil;
}*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment