- via werfe: github "werfe/SegmentHeaderView"
- or copy SegmentHeaderView folder to your project
- Import UISCrollView+SegmentHeader category to your table/scroll/colleciton view
#import "UISCrollView+SegmentHeader.h"
- In "viewDidAppear"
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
_tableView.enabledSegment = YES;
//Do not forget add target action for Segment
[_tableView.segmentHeaderView.segmentControl addTarget:self action:@selector(segmentControlDidClicked:) forControlEvents: UIControlEventValueChanged];
}
- Add a method required
#pragma mark - methods required
-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
[_tableView scrollViewDidScroll:scrollView];
}
- That's it!
- Skype: live:werfe
- Mail: [email protected]
The MIT License (MIT)