iOS UISlider SWIFT Example

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9


 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!)

Got any iOS Question?