Protocol

UIView​Controller​Transition​Coordinator​Context

An object that conforms to the UIView​Controller​Transition​Coordinator​Context protocol provides information about an in-progress view controller transition. Do not adopt this protocol in your own classes. UIKit creates an object that adopts this protocol and makes it available to your code when you animate changes using a transition coordinator object.

Overview

A transition coordinator context provides most of the same information as an object that adopts the UIView​Controller​Context​Transitioning protocol. You use this contextual information to determine the animation parameters, such as the view in which the animations take place, whether the transition is interactive, or whether the transition was the result of an interface orientation change. You then apply that information to the animations you create.

Most animations take place in the view returned by the container​View method. And at the time your animation blocks are executed, the view hierarchy already contains the view of the from view controller. You can use your animation blocks to animate additional content in that same container view or you can animate content in an entirely different view.

Symbols

Getting the Views and View Controllers

func view(for​Key:​ UITransition​Context​View​Key)

Returns the specified view involved in the transition.

var container​View:​ UIView

Returns the view in which the transition takes place.

Getting the Behavior Attributes

var presentation​Style:​ UIModal​Presentation​Style

Returns the presentation style being used for the transition.

var transition​Duration:​ Time​Interval

Returns the noninteractive duration of a transition.

var completion​Curve:​ UIView​Animation​Curve

Returns the completion curve associated with the transition.

var completion​Velocity:​ CGFloat

Returns the starting velocity to use for any final animations.

var percent​Complete:​ CGFloat

Returns the percentage of completion for an interactive transition when it moves to its noninteractive phase.

Getting the Transition State

var initially​Interactive:​ Bool

Returns a Boolean value indicating whether the transition started as an interactive transition.

Getting the Rotation Factor

var target​Transform:​ CGAffine​Transform

Returns a transform indicating the amount of rotation being applied during the transition.

Relationships

Inherits From