CATransition

From iPhone Development Wiki
Revision as of 05:24, 26 October 2014 by Uroboro (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

CATransition is an Objective-C wrapper for creating view transitions. As of 3.1.2, there are 11 types of transitions. 4 of them are SDK-compatible, but are the most boring ones. The following shows all 11 types of transition from picture "A" to "B" at 40%. The subtypes, if any, is "fromLeft".

Subtype and filter

Many transitions have are further divided into several discrete subtypes. They often control the movement direction of the animation.

Some transitions accept addition arguments through the filter property, for example, you can set the location of suckEffect using

...
CAFilter* filter = [CAFilter filterWithName:@"suckEffect"];
[filter setValue:[NSValue valueWithCGPoint:CGPointMake(160, 240)] forKey:@"inputPosition"];
transition.filter = filter;
...
Transition Subtypes Accepted parameters
moveIn
push
reveal
fromLeft, fromRight, fromBottom, fromTop -
pageCurl, pageUnCurl fromLeft, fromRight, fromTop, fromBottom float inputColor[];
cube
alignedCube
fromLeft, fromRight, fromTop, fromBottom float inputAmount; (perspective)
flip
alignedFlip
oglFlip
fromLeft, fromRight, fromTop, fromBottom float inputAmount;
cameraIris - CGPoint inputPosition;
rippleEffect - -
rotate 90cw, 90ccw, 180cw, 180ccw -
suckEffect - CGPoint inputPosition;

Availability

The following shows the availability of different CATransitions starting from 2.0:

CATransition Availability
fade
moveIn
push
reveal
(Public API) 2.0–
flip
alignedFlip
oglFlip
2.0–
cube
alignedCube
2.0–
pageCurl
pageUnCurl
2.0–
rippleEffect 2.0–
suckEffect 2.0–
cameraIris
cameraIrisHollowOpen
cameraIrisHollowClose
2.0–
rotate 4.0–
spewEffect
genieEffect
unGenieEffect
twist
swirl
charminUltra
reflection
zoomyIn
zoomyOut
mapCurl
mapUnCurl
oglApplicationSuspend
cameraIrisHollow
2.0–2.2

External links