Skip to content

nsomar/RangeSliderView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RangeSliderView

CI Status Version License Platform



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, o.arrabi@me.com

License

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

About

RangeSliderView provide an easy to use range selection view.

Resources

License

Stars

Watchers

Forks

Packages

No packages published