I have a collection view which shows multiple images of peoples and their names, and I have implemented search and sorting functionality. However, the problem is I want alphabetical also, but the collection view does not have delegate methods like UITableView
has.
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView {
return[NSArray arrayWithObjects:@"a", @"e", @"i", @"m", @"p", nil];
}
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString
*)title atIndex:(NSInteger)index {
return <yourSectionIndexForTheSectionForSectionIndexTitle >;
}
I had tried this question also, but this shows collection view cells in a section. I don't want multiple sections. I want only section and implement alphabetical scroll functionality it.
Above methods are not in UICollectionViewDelegate
methods.
BDKCollectionIndexView
implements a UITableView
-like section index bar. It's pretty easy to integrate once you have it positioned onscreen: just assign an array of NSString
s from your datasource:
self.indexView.indexTitles = self.fetchResultsController.sectionIndexTitles;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With