01// Begin animation setup
02[UIView beginAnimations:nil context:NULL];
03
04// Set duration for animation
05[UIView setAnimationDuration:1];
06
07// Set function to be called when animation is complete
08[UIView setAnimationDidStopSelector: @selector(animDone:finished:context:)];
09
10// Set the delegate (This object must have the function animDone)
11[UIView setAnimationDelegate:self];
12
13// Set Animation type and which UIView should animate
14[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:myUIView cache:YES];
15
16// Add subview to the UIView set in the previous line
17[myUIView addSubview:mySubView];
18
19//Start the animation
20[UIView commitAnimations];
21
22// Function to be called when the animation is complete
23-(void)animDone:(NSString*) animationID finished:(BOOL) finished context:(void*) context
24{
25 // Add code here to be executed when the animation is done
26}