I want the slider to set value slowly and for that I am using this code
[UIView animateWithDuration:2.0 animations:^{
[self.slider setValue:(float)val];
}];
But this is not working. Please help me out.
I want the slider to set value slowly and for that I am using this code
[UIView animateWithDuration:2.0 animations:^{
[self.slider setValue:(float)val];
}];
But this is not working. Please help me out.
What I have found is that the animation will not work is the animation is scheduled while the view is still loading. So instead of this (which does not animate):
I do the following, where animateSlider is an internal method:
The afterDelay:0 means that the animation will be scheduled for the very next runloop.
Use
[self.slider setValue:(float)val animated:YES];
instead.