CATransition VS UIView beginAnimations

April 5, 2009 § Leave a comment

CATransition gives you more control. You can store the object and reuse the code for the animation effect. This will save duplication.

UIView class methods are convenience methods for common animations. It only supports four possible transition types (flip left, flip right, curl up, curl down). You would have to write custom code to animate UIView alpha.

CATransition *myAnimationView = [CATransition animation];
[myAnimationView setDuration:1];
[myAnimationView setType:kCATransitionReveal];
[myAnimationView setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]];
[[myview layer] addAnimation:myAnimationView forKey:kCATransitionReveal];

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.75];
[UIView setAnimationDelegate:self];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:myview cache:YES];
[myview removeFromSuperview];
[UIView commitAnimations];
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading CATransition VS UIView beginAnimations at Web Builders.

meta

%d bloggers like this: