Latest 0.1.0
Homepage https://github.com/oarrabi/RangeSliderView
License MIT
Platforms ios 8.0, osx 10.9, requires ARC
Authors

CI Status
Version
License
Platform


RangeSliderView

RangeSliderView is a NSControl/UIControl subclass that provides an easy control to select a range.

Features

  • Cross platform; works on the iOS and MacOSX.
  • Customisable Knob and Progress colors.
  • @IBDesignable and @IBInspectable

Installation

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

pod "RangeSliderView"

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Using Interface builder

You can add RangeSliderView in your view using Interface builder by dragging a view and set RangeSliderView as the custom view class.

You can add an action using normal target action.

RangeSliderView contain inspectable properties, to change it’s properties, edit the inspectable values in Interface Builder.

Inspectable

Using code

Create a RangeSliderView and add it as a subview

let rangeSliderView = RangeSliderView(frame: CGRect(x: 10, y: 10, width: 200, height: 50))
self.view.addSubview(rangeSliderView)

To add actions, you can either use Target/Action or blocks. To use target/action:

On Mac

rangeSliderView.target = self
rangeSliderView.action = "valueChanged:"

On iOS

rangeSliderView.addTarget(self, action: "valueChanged:", forControlEvents: .ValueChanged)

For block action callbacks use the following

rangeSliderView.selectedValuesChanged = { min, max in
}

Customisation

The following are customisable properties of the RangeSliderView:

sliderKnobColor Sets the Knob background color (Defaults to white)

sliderKnobHighligtedColor Sets the Knob highlight color (Defaults to light grey)

sliderKnobBorderColor Sets the Knob border color (Defaults to grey)

sliderProgressFilledColor Sets the slider progress filled color (Defaults to blue)

sliderProgressEmptyColor Sets the slider progress empty color (Defaults to grey)

screenshots

Mac:

Normal colors
Fancy colors

iOS:

Normal colors
Fancy colors

Author

Omar Abdelhafith, [email protected]

License

RangeSliderView is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "RangeSliderView",
    "version": "0.1.0",
    "summary": "RangeSliderView provide an easy to use range slider view.",
    "description": "RangeSliderView is a NSControl/NSControl/UIControl subclass that provides an easy control to select a range.",
    "homepage": "https://github.com/oarrabi/RangeSliderView",
    "screenshots": [
        "http://i.imgur.com/PkG5mJG.png",
        "http://i.imgur.com/RDusAaZ.png"
    ],
    "license": "MIT",
    "authors": {
        "Omar Abdelhafith": "[email protected]"
    },
    "source": {
        "git": "https://github.com/oarrabi/RangeSliderView.git",
        "tag": "0.1.0"
    },
    "social_media_url": "https://twitter.com/ifnottrue",
    "platforms": {
        "ios": "8.0",
        "osx": "10.9"
    },
    "requires_arc": true,
    "source_files": [
        "Pod/Classes/**/*"
    ],
    "pod_target_xcconfig": {
        "ENABLE_TESTABILITY": "YES"
    }
}

Pin It on Pinterest

Share This