Can I use the value I obtain(sender.value) to change the color as the slider moves? I am trying to change the color from green to yellow to red as the slider moves. Please help in swift thanks!
let brokeSlider = UISlider(frame:CGRectMake(5, 440, 355, 20))
brokeSlider.minimumValue = 0
brokeSlider.maximumValue = 1
brokeSlider.continuous = true
brokeSlider.tintColor = UIColor.blackColor()
brokeSlider.value = 0
brokeSlider.addTarget(self, action: #selector(AnnotationPhotoWidget.sliderValueDidChange(_:)), forControlEvents: .ValueChanged)
self.view.addSubview(brokeSlider)
func sliderValueDidChange(sender:UISlider) {
print("value--\(sender.value)")
}