Latest 1.1.0
Homepage https://github.com/MTT-IOS/MTTCircularSlider
License MIT
Platforms ios 7.0, requires ARC
Authors

中文介绍

MTTCircularSlider is a circular slider for IOS

(Dome)

Installation

MTTCircularSlider is available on CocoaPods. Just add the following to your project Podfile:

pod 'MTTCircularSlider'

Usage

See dome Xcode project in /MTTCircularSliderDome

Default Style

MTTCircularSlider* slider = [[MTTCircularSlider alloc] initWithFrame:CGRectMake(100, 100, 150, 150)];
[self.view addSubview:slider];

Image Style

Dome

MTTCircularSlider* slider = [[MTTCircularSlider alloc] initWithFrame:CGRectMake(100, 100, 150, 150)];
slider.sliderStyle = MTTCircularSliderStyleImage;
slider.unselectImage = [UIImage imageNamed:@"unselect.png"];
slider.selectImage = [UIImage imageNamed:@"select.png"];
slider.indicatorImage = [UIImage imageNamed:@"indicator.png"];
[self.view addSubview:slider];

Image material(PSD Source)

unselectImage
selectImage
indicatorImage

Event

[slider addTarget:self action:@selector(sliderValueChanged:) forControlEvents:UIControlEventValueChanged];
[slider addTarget:self action:@selector(sliderEditingDidEnd:) forControlEvents:UIControlEventEditingDidEnd;

Options

sliderStyle:(MTTCircularSliderStyle)

  • MTTCircularSliderStyleDefault = 1, //Default Style
  • MTTCircularSliderStyleImage = 2, //Customize Image Style
  • MTTCircularSliderStyleNone = 0, //None Style
@property (nonatomic) MTTCircularSliderStyle sliderStyle;//Default:MTTCircularSliderStyleDefault

circulate:(BOOL)

@property (nonatomic, getter=isCirculate) BOOL circulate;//Default:NO

MTTCircularSliderStyleDefault

The parameters are effective when MTTCircularSliderStyleDefault

@property (nonatomic) CGFloat lineWidth; //Default:20
@property (nonatomic, strong) UIColor* selectColor; //Default:#0a68ff
@property (nonatomic, strong) UIColor* unselectColor; //Default:#b5b5b5
@property (nonatomic, strong) UIColor* indicatorColor; //Default:#FFFFFF
@property (nonatomic) CGFloat contextPadding; //Default:10

MTTCircularSliderStyleImage

The parameters are effective when MTTCircularSliderStyleImage

@property (nonatomic, strong) UIImage* selectImage;
@property (nonatomic, strong) UIImage* unselectImage;
@property (nonatomic, strong) UIImage* indicatorImage;

Angle

@property (nonatomic) NSInteger angle; //Default:0
@property (nonatomic) NSInteger maxAngle; //Default:360
@property (nonatomic) NSInteger minAngle; //Default:0

Value

@property (nonatomic) CGFloat value; //Default:0
@property (nonatomic) CGFloat minValue; //Default:0
@property (nonatomic) CGFloat maxValue; //Default:1

License

MIT

Latest podspec

{
    "name": "MTTCircularSlider",
    "version": "1.1.0",
    "summary": "A circular slider for IOS",
    "homepage": "https://github.com/MTT-IOS/MTTCircularSlider",
    "license": "MIT",
    "authors": {
        "MTT": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/MTT-IOS/MTTCircularSlider.git",
        "tag": "1.1.0"
    },
    "source_files": "MTTCircularSlider/*.{h,m}",
    "requires_arc": true
}

Pin It on Pinterest

Share This