I have to make that the thumb of my slider has a "blink" effect, but only the thumb not the whole slider. What I had thought is to use a timer that for example every 0.8 seconds lowers and raises the alpha value of the thumb.
var alpha = 1.0
timerAlpha = Timer.scheduledTimer(withTimeInterval: 0.8,repeats: true)
{t in
self.slider.setThumbImage(thumb, for: UIControl.State(rawValue: UIControl.State.RawValue(alphaValue)))
self.slider.alpha = CGFloat(alpha)
if alpha == 1.0{
alpha = 0.5
}else{
alpha = 1.0
}
}
But the problem is that this way I blink the whole slider and not ONLY the thumb. How do I make only the thumb blink