CATransition Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/QuartzCore.framework
Availability
Available in OS X v10.5 and later.
Declared in
CAAnimation.h
Companion guides
Related sample code

Overview

The CATransition class implements transition animations for a layer. You can specify the transition effect from a set of predefined transitions or by providing a custom CIFilter instance.

Tasks

Transition Start and End Point

Transition Properties

Custom Transition Filter

Properties

endProgress

Indicates the end point of the receiver as a fraction of the entire transition.

@property float endProgress
Discussion

The value must be greater than or equal to startProgress, and not greater than 1.0. If endProgress is less than startProgress the behavior is undefined. The default value is 1.0.

Availability
  • Available in OS X v10.5 and later.
Declared In
CAAnimation.h

filter

An optional Core Image filter object that provides the transition.

@property(retain) CIFilter *filter
Discussion

If specified, the filter must support both kCIInputImageKey and kCIInputTargetImageKey input keys, and the kCIOutputImageKey output key. The filter may optionally support the kCIInputExtentKey input key, which is set to a rectangle describing the region in which the transition should run. If filter does not support the required input and output keys the behavior is undefined.

Defaults to nil. When a transition filter is specified the type and subtype properties are ignored.

Special Considerations

Core Image is available only in iOS 5 and later. In earlier versions of iOS, the filters you would assign to this property are unavailable and therefore cannot be used to create transitions.

Availability
  • Available in OS X v10.5 and later.
Declared In
CAAnimation.h

startProgress

Indicates the start point of the receiver as a fraction of the entire transition.

@property float startProgress
Discussion

Legal values are numbers between 0.0 and 1.0. For example, to start the transition half way through its progress set startProgress to 0.5. The default value is 0.

Availability
  • Available in OS X v10.5 and later.
Declared In
CAAnimation.h

subtype

Specifies an optional subtype that indicates the direction for the predefined motion-based transitions.

@property(copy) NSString *subtype
Discussion

The possible values are shown in “Common Transition Subtypes”. The default is nil.

This property is ignored if a custom transition is specified in the filter property.

Availability
  • Available in OS X v10.5 and later.
Declared In
CAAnimation.h

type

Specifies the predefined transition type.

@property(copy) NSString *type
Discussion

The possible values are shown in “Common Transition Types”. This property is ignored if a custom transition is specified in the filter property. The default is kCATransitionFade.

Availability
  • Available in OS X v10.5 and later.
Declared In
CAAnimation.h

Constants

Common Transition Types

These constants specify the transition types that can be used with the type property.

NSString * const kCATransitionFade;
NSString * const kCATransitionMoveIn;
NSString * const kCATransitionPush;
NSString * const kCATransitionReveal;
Constants
kCATransitionFade

The layer’s content fades as it becomes visible or hidden.

Available in OS X v10.5 and later.

Declared in CAAnimation.h.

kCATransitionMoveIn

The layer’s content slides into place over any existing content. The “Common Transition Subtypes” are used with this transition.

Available in OS X v10.5 and later.

Declared in CAAnimation.h.

kCATransitionPush

The layer’s content pushes any existing content as it slides into place. The “Common Transition Subtypes” are used with this transition.

Available in OS X v10.5 and later.

Declared in CAAnimation.h.

kCATransitionReveal

The layer’s content is revealed gradually in the direction specified by the transition subtype. The “Common Transition Subtypes” are used with this transition.

Available in OS X v10.5 and later.

Declared in CAAnimation.h.

Declared In
CATransition.h

Common Transition Subtypes

These constants specify the direction of motion-based transitions. They are used with the subtype property.

NSString * const kCATransitionFromRight;
NSString * const kCATransitionFromLeft;
NSString * const kCATransitionFromTop;
NSString * const kCATransitionFromBottom;
Constants
kCATransitionFromRight

The transition begins at the right side of the layer.

Available in OS X v10.5 and later.

Declared in CAAnimation.h.

kCATransitionFromLeft

The transition begins at the left side of the layer.

Available in OS X v10.5 and later.

Declared in CAAnimation.h.

kCATransitionFromTop

The transition begins at the top of the layer.

Available in OS X v10.5 and later.

Declared in CAAnimation.h.

kCATransitionFromBottom

The transition begins at the bottom of the layer.

Available in OS X v10.5 and later.

Declared in CAAnimation.h.

Declared In
CATransition.h