I have a UIImageView that is displaying a series of pictures as an animation. This part of the project works well.
I want to display a label when the animation ends. Is there an event that the Imageview will trigger when it's animation ends?
I have a UIImageView that is displaying a series of pictures as an animation. This part of the project works well.
I want to display a label when the animation ends. Is there an event that the Imageview will trigger when it's animation ends?
Doesn't look like there is an event/delegate for this. My first instinct would be to calculate the length of the animation yourself, and then set up an NSTimer so that when the animation ends, NSTimer fires displaying whatever you want to display next.
Set the duration the animation will go using setAnimationDuration:
At the same time you configure performSelector:withObject:withDelay
with the same delay as the duration the animation will go on
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0]; //the animation will last for 1.0s
//some animation code here
[UIView commitAnimations];
[self performSelector:@selector(someMethodToDisplayLabel) withObject:nil afterDelay:1.0];
//someMethodToDisplayLabel will be called after 1.0s