Skip to content
Branch: master
Clone or download
Latest commit 46d40b8 Oct 19, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
DTSlider 【Upgrate】Confuse for App Store Oct 7, 2018
DoubleThumbSliderDemo.xcodeproj Update README Jul 2, 2018
DoubleThumbSliderDemo.xcworkspace Update README Jul 2, 2018
DoubleThumbSliderDemo Update README Jul 2, 2018
Pods Add license Jul 2, 2018
.DS_Store Support Custom Image Jul 1, 2018
.gitignore remove old file Jul 3, 2018
DTSlider.podspec 【Upgrate】Confuse for App Store Oct 7, 2018
LICENSE Add license Jul 2, 2018
Podfile Add license Jul 2, 2018
Podfile.lock Add license Jul 2, 2018 Update Oct 19, 2018
Slider.gif Update README Jul 2, 2018


A slider with two thumbs.


Warning !!

for 0.0.4 Refused by Apple

DTSlider use private APIs of UISlider class, It will cause your App refused by App Store.

DTSlider 用到了 UISlider 类中的私有 API,这将会导致你的 App 会被拒绝上传至 App Store。

for 0.1.0

DTSlider has confuse private APIs, but did not test on App Store.

DTSlider 混淆了私有 APIs,但是并没有做上传 App Store 测试。

Preview 效果图


USAGE 使用方式


pod 'DTSlider'


drag DTSlider folder into your project.


#import "DTSlider.h"
// DTSlider.h

@interface DTSlider : UISlider

@property (nonatomic, assign) float maxValue;

@property (nonatomic, assign) float minValue;

- (void)setMinValue:(float)minValue animated:(BOOL)animated;
- (void)setMaxValue:(float)maxValue animated:(BOOL)animated;
- (void)setMinValue:(float)minValue maxValue:(float)maxValue animated:(BOOL)animated;


Create Instance

// in the other file.
DTSlider *slider = [[DTSlider alloc] init];
slider.maxValue = 100.0;	//	init value
slider.minValue = 0.0;		//	init value
[slider addTarget:self action:@selector(sender:event:) forControlEvents:UIControlEventValueChanged];

// selector
- (void)sender:(DTSlider *)sender event:(UIControlEvent)event {
	NSLog(@"min value:%f\nmax value:%f\n", sender.minValue, sender.maxValue);

//	set value without animation
slider.maxValue = 100.0;
slider.minValue = 0.0;

// set value with animation
[slider setMaxValue:100.0 animated:YES];
[slider setMinValue:1.0 animated:YES];

You can use the component like UISlider, and set the value with minValue and maxValue properties. In the mean time, you can also set target-action to touch the event of value changing, call getters of the properties to get new value. The value property of super-class is the value which changed by user, it means that value will equal to minValue or maxValue.

使用方式类似系统自带的 UISlider,可以通过 minValuemaxValue 来设置控件的值。同时,可以通过设置 target-action 的方式来监听 ValueChanged 事件,并且通过这两个属性来获取到新的值。父类中的 value 属性代表着用户变化的那个值,这意味着 value 属性可能等于 maxValue 也可能等于 minValue



You can’t perform that action at this time.