title: "Various Animation Effects for Screen Transitions in iOS Development with Private APIs"
date: "2012-06-18"
categories:
- "mobileinternet"
- "sourceandcoding"
tags: - "api"
- "ios"
The animation effects for screen transitions in iOS are mainly achieved by calling the system-defined animation effects. These effects already cover most of the development needs. If more complex effects are required, CATransition can be considered for implementation.
Here are the four basic effects:
kCATransitionPush: Push effect
kCATransitionMoveIn: Move-in effect
kCATransitionReveal: Reveal effect
kCATransitionFade: Fade-in and fade-out effect
The following API effects can be safely used:
cube: Cube effect
suckEffect: Suck effect
rippleEffect: Ripple effect
pageCurl: Page curl effect (upwards)
pageUnCurl: Page uncurl effect (downwards)
oglFlip: Flip effect (upside down)
cameraIrisHollowOpen: Camera iris hollow open effect
cameraIrisHollowClose: Camera iris hollow close effect
The following API effects should be used with caution:
spewEffect: New screen is released from the middle of the screen below to cover the old screen.
genieEffect: Old screen is sucked away from the bottom left or bottom right of the screen, revealing the new screen underneath.
unGenieEffect: New screen is released from the bottom left or bottom right of the screen to cover the old screen.
twist: Screen twists out horizontally like a tornado.
tubey: Screen pops out vertically with elasticity.
swirl: Old screen rotates 360 degrees and fades out, revealing the new screen.
charminUltra: Old screen fades out and displays the new screen.
zoomyIn: New screen zooms in from small to large in front, while the old screen zooms out and disappears.
zoomyOut: New screen appears by scaling from outside the screen, while the old screen shrinks and disappears.
oglApplicationSuspend: Effect similar to pressing the "home" button.
Usage of animation effects:
CATransition *animation = [CATransition animation];
animation.duration = 10.5f;
animation.timingFunction = UIViewAnimationCurveEaseInOut;
animation.fillMode = kCAFillModeForwards;
// Basic type
animation.type = kCATransitionPush;
// Private API, string type
animation.type = "cube";
[self.view.layer addAnimation forKey:@"animation"];
Reference link:
http://hi.baidu.com/jj89757hhb/item/a5108a80e078d45b26ebd9f3