I want to animate increment of numbers starting from 1 to a limit (variable) , the duration of animation is 1.5 seconds. each time when I call the method this animation should work ( animate increment from 0 to (eg: 70 ).
int j=1;
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration: 1.5];
[UIView setAnimationDelegate: self];
do{
self.label.text=[NSString stringWithFormat:@"%ï", j];
}
while(j<=limit);
[UIView commitAnimations];
Please help to animate the incrementing of the numbers…..
You can’t do something like this. You can only animate the animatable properties of a view. These are:
frame,bounds,center,transform,alpha,backgroundColorandcontentStretch.You want to use a
NSTimerthat updates the label every 1.5 seconds.Probably something along those lines:
and then start the timer with
[self startAnimationWithLimit:70];