Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Story5/SortOptionView

Repository files navigation

Version Commit Data New In Version
1.0 2017εΉ΄03月28ζ—₯ The first Version
1.1 2017εΉ΄03月31ζ—₯ -imageShowStatusArrayForSortOptionView:
1.2 2017εΉ΄07月13ζ—₯ -setCurrentSelectedItem:

Style

guide

Usage

1.Init and Show

SortOptionView *sortOptionView = [[SortOptionView alloc] init];
sortOptionView.dataSource = self;
sortOptionView.delegate = self;
[aSuperView addSubview: sortOptionView];
[sortOptionView show];

2. Implement the method of 'SortOptionViewDataSource' protocol

(1)Return the every button's title

- (NSArray *)titleArrayForSortOptionView:(SortOptionView *)sortOptionView
{
 return @[@"SortTitle1",@"SortTitle2",@"SortTitle3"];
}

(2)Return the every button's image show status to determine show the image or not

- (NSArray *)imageShowStatusArrayForSortOptionView:(SortOptionView *)sortOptionView
{
 return @[@"0",@"1",@"1"];
}

3.Implement the method of 'SortOptionViewDelegate' protocol

- (void)sortOptionView:(SortOptionView *)sortOptionView didClickedItemAtIndex:(NSUInteger)index sortOption:(SortOptionType)sortOption
{
 switch (sortOption) {
 case SortOptionNormal:
 NSLog(@"SortOptionNormal");
 break;
 case SortOptionUp:
 NSLog(@"SortOptionUp");
 break;
 case SortOptionDown:
 NSLog(@"SortOptionDown");
 break;
 default:
 break;
 }
 NSLog(@"index : %lu",index);
 // do something by judge the index and sortOption
}

4.Set default selected item

[sortOptionView setCurrentSelectedItem:0];

Installation

1.Run 'git clone'

git clone https://github.com/GGSDU/SortOptionView

2.Import the SortOptionView folder to your project.

Code with Us together

If you'd like to code with us and make the project better,contact me and join us.

About

πŸ‡¨πŸ‡³A view for set the the sort option.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /