Skip to content

Harsh061/HPRangeSlider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HPRangeSlider

HPRangeSlider is a pod which helps to add slider to any UIVIew. It is written in Swift 4.

Installation

Using Cocoapods

  1. Open podfile in your project.
  2. Add the following into your podfile:
pod ‘HPRangeSlider’, :git => ‘https://github.com/Harsh061/HPRangeSlider.git’, :tag => ‘1.0.0’ 
  1. Run the command:
pod install

Usage

  1. Open the project. Drag a UIView into storyboard.
  2. Go the the identity inspector and in the class field, type HPRangeSlider instead of UIView.
  3. Open the viewcontroller. Import HPRangeSlider.
import HPRangeSlider
  1. Create an outlet of the view.
@IBOutlet weak var rangeSlider: HPRangeSlider!
  1. Set your custom properties like sliderTitle, value, minValue, maxValue and handleTintColor.

Example:

private func setupSlider() {
   rangeSlider.delegate = self
   rangeSlider.sliderTitle = ""
   rangeSlider.value = 0
   rangeSlider.minValue = 0
   rangeSlider.maxValue = 10
   rangeSlider.handleTintColor = UIColor.red
}
  1. Confirm to the delegate method
extension ViewController: HPRangeSliderDelegate {
    func rangeSlider(selectedValue: Float) {
        print("Current value", selectedValue)
    }
}

About

HPRangeSlider is a pod which helps to add slider to any UIVIew. It is written in Swift 4.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published