Init your DKFilterView by constucting a DKFilterModel which contains your own selection value.
There are three types,DK_SELECTION_SINGLE
,DK_SELECTION_MULTIPLE
and DK_SELECTION_PICK
.
Run Demo to see each's behavior.
NSArray *filterData = @[@"Apple",@"Pear",@"Mango",@"Orange",@"Lychee",@"Coconut"];
DKFilterModel *model = [[DKFilterModel alloc] initElement:filterData ofType:DK_SELECTION_SINGLE];
model.title = @"Click";
model.style = DKFilterViewStyle1;
DKFilterView *filterView = [[DKFilterView alloc] initWithFrame:self.view.frame];
[self.view addSubview:filterView];
[filterView setFilterModels:@[model]];
Implement DKFilterViewDelegate
to customize your own header view or click behavior.
- (NSInteger)getCustomSectionHeaderHeight;
- (DKFilterSectionHeaderView *)getCustomSectionHeader;
- (void)didClickAtModel:(DKFilterModel *)data;
To install it, simply add the following line to your Podfile:
pod 'DKFilterView', :git => 'https://github.com/drinking/DKFilterView.git'
Since it's a beta version, DKFilterView now is not available through CocoaPods.
Drinking, [email protected]
DKFilterView is available under the MIT license. See the LICENSE file for more info.