Skip to content

Instantly share code, notes, and snippets.

@JeOam
Last active July 17, 2018 05:04
Show Gist options
  • Save JeOam/9b23f9539549479e61a3 to your computer and use it in GitHub Desktop.
Save JeOam/9b23f9539549479e61a3 to your computer and use it in GitHub Desktop.
UITableView Tips
@JeOam
Copy link
Author

JeOam commented Apr 23, 2015

TableView with Index

-(NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView{
    return self.indexArray;
}

- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index
{
    return index;
}
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    return [self.indexArray objectAtIndex:section];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    ....
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment