In my iPhone application
I am doing certain animations. like
[UIView beginAnimations:@"stalk" context:nil];
[UIView setAnimationDuration:1];
[UIView setAnimationBeginsFromCurrentState:YES];
self.frame=originalSelf;
[UIView commitAnimations];
After completion of this animation I want tocall some methods...
I know something abt block animations or
DidStopAnimation notification
How do I do that.... Thanks..
On iOS 4 and later, using blocks is recommended for this purpose:
[UIView animateWithDuration:1
animations:^{
self.frame=originalSelf;}
completion:^(BOOL finished){
//My method call;
}
];
Try using
[UIView beginAnimations:@"stalk" context:nil];
[UIView setAnimationDuration:1];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(afterAnimationStops)]
self.frame=originalSelf;
[UIView commitAnimations];
And then you can implement method
-(void)afterAnimationStops{
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With