CocoaPods trunk is moving to be read-only. Read more on the blog, there are 14 months to go.
| TestsTested | ✓ |
| LangLanguage | Obj-CObjective C |
| License | MIT |
| ReleasedLast Release | Dec 2014 |
Maintained by Seb C. Thiebaud.
A custom component like UISegmentedControl highly customizable.
You can use CocoaPods by adding STTimeSlider in your Podfile. If you don't want to use this method, please refer to the following method:
Please include these 4 files:
STTimeSlider.hSTTimeSlider.mSTTimeSliderModeView.hSTTimeSliderModeView.mAnd include QuartzCore.framework and CoreGraphics.framework.
This plugin is highly customizable. You can customize:
STTimeSliderMode mode: The mode of the slider (multi points or solo)int startIndex: In mode STTimeSliderModeMulti, it's the initial departure pointfloat numberOfPoints: The number of points (more than 1)float radiusPoint: (1) The radius of the pointfloat heightLine: (2) The height of the line between two points. The height must be lower than radiusPoint * 2;float spaceBetweenPoints: (3) The space between two pointsfloat radiusCircle: (4) The radius of the point inside the selected circlesCGGradientRef gradient: The gradient of the background barCGGradientRef gradientForeground: The gradient of the foreground barUIColor *strokeColor: The color of the background bar's stroke.float strokeSize: The size of the background bar's stroke.UIColor *strokeColorForeground: The color of the foreground bar's stroke.float strokeSizeForeground: The size of the foreground bar's stroke.CGSize shadowSize: The size.float shadowBlur: The blur.UIColor *shadowColor: The color.Build and run the project STTimeSliderExample in Xcode to see STTimeSlider in action.
STTimeSlider *timeSlider = [[STTimeSlider alloc] initWithFrame:CGRectMake(5.0, 5.0, 310.0, 110.0)];
[timeSlider setDelegate:self];
[self.view addSubview:timeSlider];Don't forget to implementSTTimeSliderDelegate protocol in your ViewController. Without it, you won't be able to detect when the user will change the index:
- (void)timeSlider:(STTimeSlider *)timeSlider didSelectPointAtIndex:(int)index {
NSLog(@"User clicked on TimeSlider %@ at Index %d", timeSlider, index);
}or when the slider has changed:
- (void)timeSlider:(STTimeSlider *)timeSlider didMoveToPointAtIndex:(int)index {
NSLog(@"TimeSlider %@ has changed at Index %d", timeSlider, index);
}You can change the index of the slider with - (void)moveToIndex:(int)index;.
Sebastien Thiebaud
STTimeSlider is available under the MIT license.