索引的相关属性设置:
tableView.sectionIndexColor = [UIColor blueColor];//设置默认时索引值颜色
tableView.sectionIndexTrackingBackgroundColor = [UIColor grayColor];//设置选中时,索引背景颜色
tableView.sectionIndexBackgroundColor = [UIColor clearColor];//索引背景颜色
实现tableView索引相关的代理
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
-(NSArray<NSString *> *)sectionIndexTitlesForTableView:(UITableView *)tableView
//响应点击索引时的委托方法
-(NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index;