iOS Developer Library

Developer

UIKit Framework Reference UIViewControllerInteractiveTransitioning Protocol Reference

Options
Deployment Target:

On This Page
Language:

UIViewControllerInteractiveTransitioning

To enable an object (such as a navigation controller) to drive a view controller transition, configure a custom class to adopt the UIViewControllerInteractiveTransitioning protocol. An object that supports this protocol is called an interactive transition delegate. More...

Inheritance


Not Applicable

Import Statement


import UIKit @import UIKit;

Availability


Available in iOS 7.0 and later.
  • Called when the system needs to set up the interactive portions of a view controller transition and start the animations. (required)

    Declaration

    Swift

    func startInteractiveTransition(_ transitionContext: UIViewControllerContextTransitioning)

    Objective-C

    - (void)startInteractiveTransition:(id<UIViewControllerContextTransitioning>)transitionContext

    Parameters

    transitionContext

    The context object containing information about the transition.

    Discussion

    Your implementation of this method should use the data in the transitionContext parameter to configure user interactivity for the transition and then start the animations. While tracking user interactions, your event handling code should regularly call the context object’s updateInteractiveTransition: method to report on how much of the transition is now complete. If events indicate that the user has canceled the transition, call the cancelInteractiveTransition method. If events indicate that the transition has finished, call the finishInteractiveTransition method.

    Import Statement

    import UIKit

    Availability

    Available in iOS 7.0 and later.

  • Called when the system needs the animation completion curve for an interactive view controller transition.

    Declaration

    Swift

    optional func completionCurve() -> UIViewAnimationCurve

    Objective-C

    - (UIViewAnimationCurve)completionCurve

    Return Value

    Default value is UIViewAnimationCurveEaseInOut, with other possible values described in the UIViewAnimationCurve type definition.

    Import Statement

    import UIKit

    Availability

    Available in iOS 7.0 and later.

  • Called when the system needs the speed at which to complete an interactive transition, after the interactive portion is finished.

    Declaration

    Swift

    optional func completionSpeed() -> CGFloat

    Objective-C

    - (CGFloat)completionSpeed

    Return Value

    Default value is 1.0, which corresponds to the total (noninteractive) transition duration scaled by the percentage of the transition remaining. Value must be greater than 0.0.

    Import Statement

    import UIKit

    Availability

    Available in iOS 7.0 and later.