SWIFT Example

suggest change
let frame = CGRect(x: 0, y: 100, width: 320, height: 10)
let slider = UISlider(frame: frame)
slider.addTarget(self, action:  #selector(sliderAction), for: .valueChanged)
slider.backgroundColor = .clear
slider.minimumValue = 0.0
slider.maximumValue = 50.0
//sending a NO/False would update the value of slider only when the user is no longer touching the screen. Hence sending only the final value
slider.isContinuous = true
slider.value = 25.0

Handling the slider change event

func sliderAction(sender:UISlider!)

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents