Graphics Reference
In-Depth Information
TABLE 6-2
Default Transition Types and Their Functions
Field
Function
Fade
The constant kCATransitionFade indicates that the layer's contents should
fade in when the transition occurs.
Move In
The constant kCATransitionMoveIn indicates that the layer's contents
should slide in from some direction. The direction used is determined by a
transition's subtype (see “Transition Subtypes” in the next section). The
default transition subtype, if none is specified when kCATransitionMoveIn
is used as the main type, is kCATransitionFromLeft , which specifies the
contents should slide in from the left.
Push
The constant kCATransitionPush indicates that the layer's contents should
push any existing content from some direction. The direction used is deter-
mined by a transition's subtype (see “Transition Subtypes” in the next
section). The default transition subtype, if none is specified when
kCATransitionPush is used as the main type, is kCATransitionFromLeft ,
which specifies the contents should slide in from the left.
Reveal
The constant kCATransitionReveal indicates that the layer's contents
should be revealed from some direction. The direction used is determined by
a transition's subtype (see “Transition Subtypes” in the next section). The
default transition subtype, if none is specified when kCATransitionReveal
is used as the main type, is kCATransitionFromLeft , which specifies the
contents should slide in from the left.
The default transition subtypes are listing in Table 6-3.
TABLE 6-3
Default Transition Subtypes and Their Functions
Field
Function
From Right
The constant kCATransitionFromRight indicates that the animation will
come in from the right.
From Left
The constant kCATransitionFromLeft indicates that the animation will
come in from the left.
From Top
The constant kCATransitionFromTop indicates that the animation will come
in from the top.
From Bottom
The constant kCATransitionFromBottom indicates that the animation will
come in from the bottom.
If you want to tweak a default transition, simply add the transition to your layer's
actions field, which is an NSDictionary . Specify the property you want to use for your
transition by specifying its name as a key-path when you add your CATransition object
to the layer's actions field. When you create the layer that you want to perform the tran-
sition on, you can simply set it up there. In the next section, we get into details of return-
ing a specific action for property transitions, but here are the basic steps and the code to
alter the transition for a given property change using the default transitions during layer
instantiation:
 
Search WWH ::




Custom Search