TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Jun 2017 |
Maintained by zjmdp.
GoSegmentedControl
provides fully customizable and scrollable segmented control.
###CocoaPods
pod 'GoSegmentedControl', '~> 0.7'
###Manually
GoSegmentedControl/Classes
."GoSegmentedControl.h"
in your files.
GoSegmentedControl *segmentedControl = [[GoSegmentedControl alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth([UIScreen mainScreen].bounds), 50)];
segmentedControl.delegate = self;
segmentedControl.dataSource = self;
segmentedControl.selectionIndicatorHeight = 3;
segmentedControl.indicatorMargin = 4.f;
segmentedControl.selectionIndicatorColor = [UIColor grayColor];
- (NSInteger)numberOfSegmentsInGoSegmentedControl:(GoSegmentedControl *)segmentedControl{
return 10;
}
- (UIView *)segmentedControl:(GoSegmentedControl *)segmentedControl customSegmentViewAtIndex:(NSInteger)index{
UILabel *label = [UILabel new];
[label setText:[NSString stringWithFormat:@"Segment: %@", @(index)]];
return label;
}
- (CGFloat)segmentedControl:(GoSegmentedControl *)segmentedControl widthForSegmentAtIndex:(NSInteger)index{
return 50;
}
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
MIT license