EASliderView 0.1.3

EASliderView 0.1.3

Maintained by Emre AYDIN, Emre AYDIN.



  • By
  • aydin-emre

EASliderView

CI Status Version License Platform

Default EASliderView: EASliderView default EASliderView with info button: EASliderView with info button Customized example: EASliderView customized

Example

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

Requirements

Installation

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

pod 'EASliderView'

How To Use

Firstly, import EASliderView to your project

import EASliderView

After importing EASliderView you will be able to create a slider view either using storyboard or using swift code.

For instance, using storyboard, create an empty view and in Identity Inspector change class name as EASliderView and drag it to your swift class.

sliderView.title = "Title here"
sliderView.columns = ["Option 1", "Option 2", "Option 3"]

You can detect selected values by using onSliderValueSelected

sliderView.onSliderValueSelected = { (index) in
    print("Selected index: \(index)")
}

You can show or hide info button and column labels. And can detect info button pressed with using onInfoButtonPressed

sliderView.showColumnLabels = true // default is true

sliderView.showInfoButton = true // default is false
sliderView.onInfoButtonPressed = {
    print("Info button pressed..")
}

And also you can customize the slider.

sliderView.dotActiveColor = .black
sliderView.dotPassiveColor = .red
sliderView.lineActiveColor = .red
sliderView.linePassiveColor = .black
sliderView.thumbColor = .darkText

sliderView.titleLabelFont = UIFont.systemFont(ofSize: 14)
sliderView.titleLabelColor = .black
sliderView.columnLabelFont = UIFont.systemFont(ofSize: 13)
sliderView.columnLabelColor = .gray

Author

aydin-emre, www.emr.ee

License

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