Latest 0.2.1
Homepage https://github.com/mikeplatt/MJPSlider
License MIT
Platforms ios 7.0, requires ARC
Authors

License: MIT
CocoaPods

Synopsis

MJPSlider is a UISlider replacement with options to create a second handle, handle flags and divisions.

![screenshot] (https://github.com/mikeplatt/MJPSlider/blob/master/screenshot.png)

Installation

MJPSlider is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'MJPSlider'

If you don’t use CocoaPods, just include these files in your project:

MJPSlider.h
MJPSlider.m

Standard Features

minValue
maxValue
tintColor
setValue:(CGFloat)value animated:(BOOL)animated
setEnabled:(BOOL)enabled animated:(BOOL)animated

Range Slider Features

isRangeSlider (adds second handle)
minRange (minimum allowed value between the two handles)
setLowerValue:(CGFloat)lowerValue andUpperValue:(CGfloat)upperValue animated:(BOOL)animated

Division Features

format (NSString formatter value e.g. @"%@ - %.2f")
setDividerPoints:(NSArray *)dividers
• Format of divider points: @{ @"title" : @"Title One", @"value" : @(10) }
• Setting dividers this must be done before setting the values.
• Once dividers are set, values are set by passing the index of the disired value in the divider point array

Flag Features

showFlag
textColor
font
flagColor
flagSize
flagCornerRadius
flagPadding (distance between handle and flag)

Delegate

For best results it is best to conform to the <MJPSliderDelegate> methods:
sliderWillMove:(MJPSlider *)slider
sliderDidMove:(MJPSlider *)slider
sliderDidFinish:(MJPSlider *)slider

Code Example

MJPSlider *slider = [[MJPSlider alloc] initWithFrame:CGRectMake(10.0, 10.0, 300.0, 40.0)];
slider.minValue = 1.0;
slider.maxValue = 20.0;
slider.showFlag = YES;
slider.tintColor = [UIColor redColor];

Latest podspec

{
    "name": "MJPSlider",
    "version": "0.2.1",
    "summary": "iOS Slider",
    "homepage": "https://github.com/mikeplatt/MJPSlider",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "mikeplatt": "[email protected]"
    },
    "source": {
        "git": "https://github.com/mikeplatt/MJPSlider.git",
        "tag": "0.2.1"
    },
    "source_files": "Source/*.{m,h}",
    "requires_arc": true,
    "platforms": {
        "ios": "7.0"
    }
}

Pin It on Pinterest

Share This