iOS Developer Library

Developer

QuartzCore Framework Reference CATransition Class Reference

Options
Deployment Target:

On This Page
Language:

CATransition

Inheritance


Conforms To


Import Statement


Swift

import QuartzCore

Objective-C

@import QuartzCore;

Availability


Available in iOS 2.0 and later.

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.

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

    Declaration

    Swift

    var startProgress: Float

    Objective-C

    @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.

    Import Statement

    Objective-C

    @import QuartzCore;

    Swift

    import QuartzCore

    Availability

    Available in iOS 2.0 and later.

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

    Declaration

    Swift

    var endProgress: Float

    Objective-C

    @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.

    Import Statement

    Objective-C

    @import QuartzCore;

    Swift

    import QuartzCore

    Availability

    Available in iOS 2.0 and later.

  • type type Property

    Specifies the predefined transition type.

    Declaration

    Swift

    var type: String!

    Objective-C

    @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.

    Import Statement

    Objective-C

    @import QuartzCore;

    Swift

    import QuartzCore

    Availability

    Available in iOS 2.0 and later.

  • subtype subtype Property

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

    Declaration

    Swift

    var subtype: String!

    Objective-C

    @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.

    Import Statement

    Objective-C

    @import QuartzCore;

    Swift

    import QuartzCore

    Availability

    Available in iOS 2.0 and later.

  • filter filter Property

    An optional Core Image filter object that provides the transition.

    Declaration

    Swift

    var filter: AnyObject!

    Objective-C

    @property(strong) id 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.

    Import Statement

    Objective-C

    @import QuartzCore;

    Swift

    import QuartzCore

    Availability

    Available in iOS 2.0 and later.

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

    Declaration

    Swift

    let kCATransitionFade: String let kCATransitionMoveIn: String let kCATransitionPush: String let kCATransitionReveal: String

    Objective-C

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

    Constants

    • kCATransitionFade

      kCATransitionFade

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

      Available in iOS 2.0 and later.

    • kCATransitionMoveIn

      kCATransitionMoveIn

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

      Available in iOS 2.0 and later.

    • kCATransitionPush

      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 iOS 2.0 and later.

    • kCATransitionReveal

      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 iOS 2.0 and later.

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

    Declaration

    Swift

    let kCATransitionFromRight: String let kCATransitionFromLeft: String let kCATransitionFromTop: String let kCATransitionFromBottom: String

    Objective-C

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

    Constants

    • kCATransitionFromRight

      kCATransitionFromRight

      The transition begins at the right side of the layer.

      Available in iOS 2.0 and later.

    • kCATransitionFromLeft

      kCATransitionFromLeft

      The transition begins at the left side of the layer.

      Available in iOS 2.0 and later.

    • kCATransitionFromTop

      kCATransitionFromTop

      The transition begins at the top of the layer.

      Available in iOS 2.0 and later.

    • kCATransitionFromBottom

      kCATransitionFromBottom

      The transition begins at the bottom of the layer.

      Available in iOS 2.0 and later.