UIViewControllerTransitionCoordinatorContext Protocol Reference

Conforms to
Framework
/System/Library/Frameworks/UIKit.framework
Availability
Available in iOS 7.0 and later.
Declared in
UIViewControllerTransitionCoordinator.h

Overview

The system creates an object conforming to this protocol near the start of an animated view controller transition—specifically, before the system calls the transitionDuration method.

To obtain references to the disappearing and appearing view controllers participating in an animated transition, call the context’s viewControllerForKey: method.

Tasks

Supporting View Controller Transition Animations

Instance Methods

completionCurve

Called when a view controller transition coordinator needs the transition completion curve. (required)

- (UIViewAnimationCurve)completionCurve
Return Value

The completion curve for the view controller transition.

Discussion

Implement this method to specify a view animation curve for a view controller transition. The available values are specified in UIViewAnimationCurve.

Availability
  • Available in iOS 7.0 and later.
Declared In
UIViewControllerTransitionCoordinator.h

completionVelocity

Called when a view controller transition coordinator needs the transition completion velocity. (required)

- (CGFloat)completionVelocity
Return Value

The completion velocity for the view controller transition.

Discussion

Implement this method to specify the completion velocity for a view controller transition.

Availability
  • Available in iOS 7.0 and later.
Declared In
UIViewControllerTransitionCoordinator.h

containerView

Called when a view controller transition coordinator needs the container view for a view controller transition animation. (required)

- (UIView *)containerView
Return Value

The container view for the view controller transition animation.

Availability
  • Available in iOS 7.0 and later.
Declared In
UIViewControllerTransitionCoordinator.h

initiallyInteractive

Called when a view controller transition coordinator needs to know if a transition was initially interactive. (required)

- (BOOL)initiallyInteractive
Return Value

YES only if both of the following are true: and.

  • The isAnimated method returns true

  • The transition was initiated interactively

Discussion

The value returned by this method does not change during course of a transition.

Availability
  • Available in iOS 7.0 and later.
Declared In
UIViewControllerTransitionCoordinator.h

isAnimated

Called when a view controller transition coordinator needs to know if a transition is animated. (required)

- (BOOL)isAnimated
Return Value

YES if the transition is explicitly animated or if the transition uses the UIModalPresentationCustom presentation type; otherwise, NO.

Availability
  • Available in iOS 7.0 and later.
Declared In
UIViewControllerTransitionCoordinator.h

isCancelled

Called when a view controller transition coordinator needs to know if a transition is canceled. (required)

- (BOOL)isCancelled
Return Value

YES if an interactive transition is ending and the user canceled the transition; otherwise NO.

Availability
  • Available in iOS 7.0 and later.
Declared In
UIViewControllerTransitionCoordinator.h

isInteractive

Called when a view controller transition coordinator needs to know if a transition is interactive. (required)

- (BOOL)isInteractive
Return Value

YES if a transition is currently interactive; otherwise NO.

Discussion

This method returns the current interactive status of a view controller transition. Every interactive transition has at least one noninteractive segment—namely, when it is completing. In addition, you can design an interactive transition to have intermediate segments that are noninteractive.

Availability
  • Available in iOS 7.0 and later.
Declared In
UIViewControllerTransitionCoordinator.h

percentComplete

Called when a view controller transition coordinator needs to know the percentage completion for an interactive transition. (required)

- (CGFloat)percentComplete
Return Value

The percentage of completion of a transition when it moves to the noninteractive completion phase of the transition.

Availability
  • Available in iOS 7.0 and later.
Declared In
UIViewControllerTransitionCoordinator.h

presentationStyle

Called when a view controller transition coordinator needs to know the presentation style for the view controller that is appearing. (required)

- (UIModalPresentationStyle)presentationStyle
Return Value

A modal presentation style whose transition is being customized (see “Modal Presentation Styles”), or UIModalPresentationNone if the transition is not a modal presentation or dismissal.

Discussion

Availability
  • Available in iOS 7.0 and later.
Declared In
UIViewControllerTransitionCoordinator.h

transitionDuration

Called when a view controller transition coordinator needs to know the noninteractive duration of a transition. (required)

- (NSTimeInterval)transitionDuration
Return Value

The expected duration, in seconds, of the view controller transition, if it proceeds noninteractively.

Availability
  • Available in iOS 7.0 and later.
Declared In
UIViewControllerTransitionCoordinator.h

viewControllerForKey:

The view controller for the specified key. (required)

- (UIViewController *)viewControllerForKey:(NSString *)key
Parameters
key

The key indicating which of the two view controllers, in a view controller transition, the context pertains to.

Return Value

A key defined in the ”View Controller Transition Keys” constants in UIViewControllerContextTransitioning Protocol Reference.

Availability
  • Available in iOS 7.0 and later.
Declared In
UIViewControllerTransitionCoordinator.h