Skip to content

This class allows to add an alphabet slider to your TableView or CollectionView controllers for better movement through the list. (Like the iOS contact list)

License

Notifications You must be signed in to change notification settings

antoninlanglade/IndexingAlphabetSlider-iOS

Repository files navigation

Indexing Alphabet Slider iOS

Demo

Overview

This class allows to add an alphabet slider to your TableView or CollectionView controllers for better movement through the list. (Like the iOS contact list)

Initialization

	NSMutableArray *anArrayOfItems = [NSMutableArray array];
	AlphabetView *alphabetView = [[AlphabetView alloc] initWithFrame:CGRectMake(x , y, width, height) letters:anArrayOfItems heightLetter:20.0];
    alphabetView.delegate = self;
    [aView addSubview:alphabetView];
  1. anArrayOfItems is an array that contains the items list sort by the first character ( Ex : [@"Alice Ung",@"Bob Lint",@"John Doe"])
  2. aView is the parent which we attach this view.

Delegation & Movement

@interface AViewController : UITableViewController<AlphabetDelegate>
-(void)alphabetDelegate:(NSInteger)index{
    [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0]
                          atScrollPosition:UITableViewScrollPositionTop
                                  animated:NO];
}

About

This class allows to add an alphabet slider to your TableView or CollectionView controllers for better movement through the list. (Like the iOS contact list)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published