Latest 1.0.6
Homepage https://github.com/Andy1984/RangeSlider
License MIT
Platforms ios 8.0, requires ARC
Authors

RangeSlider

showcase gif

RangeSlider is a custom UISlider with two handler to pick a minimum and maximum range.
Inspired by https://github.com/muZZkat/NMRangeSlider

Adding RangeSlider to your project

CocoaPods
CocoaPods is the recommended way to add RangeSlider to your project.
Add the following line to your Podfile:

pod 'YWCRangeSlider', '~> 1.0'

Usage

let rangeSlider = RangeSlider(frame: frame)
view.addSubView(rangeSlider)

If you want to call a method only when touch ends

rangeSlider.changeValueContinuously = false;
rangeSlider.addTarget(self, action: #selector(sliderValueChanged(sender:)), for: .valueChanged)

else if you want to call a method whenever the value changes, no matter by code or by touch,

rangeSlider.valuesChangedHandler = {
    //write your code here, and pay attention to Circular Reference.
}

Configuration

  • minimumValue : The minimum possible value of the range
  • maximumValue : The maximum possible value of the range
  • lowHandleImageNormal: The image of low thumb
  • highHandleImageNormal: The image of high thumb
  • lowValue: set low value programmatically
  • highValue: set high value programmatically
  • func setValue(low: Double, high: Double, animated: Bool) set values animated
  • stepValue: move animatedly to a stepValue when touch ends
  • stepValueContinuously: If true, the thumb will not move until it hit a new step

Latest podspec

{
    "name": "YWCRangeSlider",
    "version": "1.0.6",
    "summary": "Custom UISlider with two handler to pick a minimum and maximum range.",
    "description": "Custom UISlider with two handler to pick a minimum and maximum range. You can custom your thumb image, background bar height, color, image. You can also set the minimum stepValue of each movement, minimumDistance.",
    "homepage": "https://github.com/Andy1984/RangeSlider",
    "screenshots": "https://raw.githubusercontent.com/Andy1984/RangeSlider/master/showcase.gif",
    "license": "MIT",
    "authors": {
        "Andy1984": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/Andy1984/RangeSlider.git",
        "tag": "1.0.6"
    },
    "source_files": "RangeSlider/RangeSlider.swift",
    "requires_arc": true,
    "pushed_with_swift_version": "3.1"
}

Pin It on Pinterest

Share This