0

I am trying to get my ui slider value while the animation progress but I am failing, I am using the above code to animate my ui slider:

UIView.animate(withDuration: 2, animations: {

self.ProgressLicht.setValue(Float(self.targetLightValue), 
animated:true)
 self.LabelLicht.text = String(describing: self.ProgressLicht.value) + 
 "%"} )

So when the animation start I see direct my ui slider final value I want to get the set the value while progressing.

Something like onProgressChanged in Android ?

picciano
  • 22,341
  • 9
  • 69
  • 82
Mohamed Elloumi
  • 158
  • 4
  • 21
  • Are you saying that you want to update the label with intermediate values between the slider's current value and the new value during the two second animation? There is no support for that. You will have to do it yourself. – rmaddy Feb 15 '18 at 16:06
  • This isn't an area I know a lot about, but might it be possible to achieve this with keyframe animations? http://mathewsanders.com/animations-in-swift-part-two/#keyframe-block-animations – Connor Neville Feb 15 '18 at 16:10

0 Answers0