Possible Duplicate:
How can I replicate the trashing animation of Mail.app
I would use the trash effect like in the image app on the iPhone. I want to trash a UIView.
Does someone know how?
Possible Duplicate:
How can I replicate the trashing animation of Mail.app
I would use the trash effect like in the image app on the iPhone. I want to trash a UIView.
Does someone know how?
Take a look at this answer: https://stackoverflow.com/a/5814846/656036
[UIView beginAnimations:@"suck" context:NULL];
[UIView setAnimationTransition:103 forView:webView cache:NO];
[UIView setAnimationDuration:1.5f];
[UIView setAnimationPosition:CGPointMake(300, 1)];
[UIView commitAnimations];
Note that this makes use of a private API and will get your App rejected by Apple. For other Animation-Transitions see http://iphonedevwiki.net/index.php/UIViewAnimationState
EDIT: iphonedevwiki.net seems to be down. However, I found something that could help you reproduce that effect and not get you rejected: (not tested) http://www.aderstedtsoftware.com/users/erik/weblog/c7cb9/
The different AnimationStates are the following (Taken from the linked SO answer):
// Efects for Animation.
// 0 (UIViewAnimationTransitionNone) Yes
// 1 (UIViewAnimationTransitionFlipFromLeft) oglFlip, fromLeft Yes
// 2 (UIViewAnimationTransitionFlipFromRight) oglFlip, fromRight Yes
// 3 (UIViewAnimationTransitionCurlUp) pageCurl Yes
// 4 (UIViewAnimationTransitionCurlDown) pageUnCurl Yes
// 101 pageCurl Yes
// 102 pageUnCurl Yes
// 103 suckEffect Yes
// 104 spewEffect No
// 105 cameraIris Yes
// 106 cameraIrisHollowClose Yes
// 107 cameraIrisHollowOpen Yes
// 108 genieEffect No
// 109 unGenieEffect No
// 110 rippleEffect Yes
// 111 twist No
// 112 tubey No
// 113 swirl No
// 114 charminUltra No
// 115 zoomyIn No
// 116 zoomyOut No
// 117 oglApplicationSuspend No
//---------------------------------------------------------------------
The specific animation used is a private API and will likely get you rejected. It is however widely documented, you can find it by searching around on SO.
You can approximate the animation used one by taking a view's layer and simultaneously transforming by rotating, applying perspective, and moving/scaling the view with Core Animation.
You can use CAAnimation to animate scale the image.
There is a video walkthrough on iTunes named Building Animation Driven Interfaces from WWDC 2010. This wil help you get started. Be sure to check CoreAnimation in Practice Part 1/2 from WWDC 2010 as well. It's really quality tutorials.