- @implementation FlipView
- - (void) touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event {
- // Start Animation Block
- CGContextRef context = UIGraphicsGetCurrentContext();
- [UIView beginAnimations:nil context:context];
- [UIView setAnimationTransition:
- UIViewAnimationTransitionFlipFromLeft
- forView:[self superview] cache:YES];
- [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
- [UIView setAnimationDuration:1.0];
- // Animations
- [[self superview] exchangeSubviewAtIndex:0 withSubviewAtIndex:1];
- // Commit Animation Block
- [UIView commitAnimations];
- }
- @end
- //该片段来自于http://www.codesnippet.cn/detail/111220137957.html
来源: http://www.codesnippet.cn/detail/111220137957.html