iOS Developer Library — Pre-Release

Developer

UIKit Framework Reference UIPercentDrivenInteractiveTransition Class Reference

Options
Deployment Target:

On This Page
Language:

UIPercentDrivenInteractiveTransition

A percent-driven interactive transition object drives the custom animation between the disappearance of one view controller and the appearance of another. It relies on a transition animator delegate—a custom object that adopts the UIViewControllerAnimatorTransitioning protocol—to set up and perform the animations. More...

Inheritance


  • NSObject
  • UIPercentDrivenInteractiveTransition
  • NSObject
  • UIPercentDrivenInteractiveTransition

Import Statement


Swift

import UIKit

Objective-C

@import UIKit;

Availability


Available in iOS 7.0 and later.
  • Indicates the animation completion curve for an interactive transition.

    Declaration

    Swift

    var completionCurve: UIViewAnimationCurve

    Objective-C

    @property(nonatomic, assign) UIViewAnimationCurve completionCurve

    Discussion

    When the interactive part of a view controller transition is complete, you can set this property to indicate a desired animation completion curve. Default value is UIViewAnimationCurveEaseInOut.

    During the interactive portion of a view controller transition, the animation curve is linear.

    Import Statement

    Swift

    import UIKit

    Availability

    Available in iOS 7.0 and later.

  • duration duration Property

    The overall duration (in seconds) of the transition animation. (read-only)

    Declaration

    Swift

    var duration: CGFloat { get }

    Objective-C

    @property(readonly) CGFloat duration

    Discussion

    This property reflects the duration of the transition animation if it were to occur without user interactions. It is obtained from the standard animator object returned by your delegate. The actual duration can vary depending on the user interactions you are tracking and responding to.

    Import Statement

    Swift

    import UIKit

    Availability

    Available in iOS 7.0 and later.

    See Also

    transitionDuration:

  • The amount of the transition (specified as a percentage of the overall duration) that is complete. (read-only)

    Declaration

    Swift

    var percentComplete: CGFloat { get }

    Objective-C

    @property(readonly) CGFloat percentComplete

    Discussion

    The value in this property reflects the last value passed to the updateInteractiveTransition: method.

    Import Statement

    Swift

    import UIKit

    Availability

    Available in iOS 7.0 and later.

  • The speed of the transition animation.

    Declaration

    Swift

    var completionSpeed: CGFloat

    Objective-C

    @property(nonatomic, assign) CGFloat completionSpeed

    Discussion

    The default value of this property is 1.0, which yields an animation that proceeds in real time. You typically change this value to speed up or slow down the animation at specific points in the transition. For example, you might change the animation speed at the end of a transition or when canceling it, in which case you would set the speed when you stop tracking user events and are about to call the cancelInteractiveTransition or finishInteractiveTransition method.

    The speed acts as a multiplier to the current animation speed, so values greater than 1.0 speed up the animation and values less than 1.0 slow it down. The value in this property must always be greater than 0.0.

    Import Statement

    Swift

    import UIKit

    Availability

    Available in iOS 7.0 and later.

  • Updates the completion percentage of the transition.

    Declaration

    Swift

    func updateInteractiveTransition(_ percentComplete: CGFloat)

    Objective-C

    - (void)updateInteractiveTransition:(CGFloat)percentComplete

    Parameters

    percentComplete

    The percentage of the transition that is currently complete, specified as a floating-point number in the range 0.0 to 1.0. If you specify a value less than 0.0, this method changes it to 0.0. Specifying a value greater than 1.0 would cause the animation to appear complete already.

    Discussion

    This is a convenience method that calls through to the updateInteractiveTransition: method of the context object.

    While tracking user events, your code should call this method regularly to update the current progress toward completing the transition. If, during tracking, the interactions cross a threshold that you consider signifies the completion or cancellation of the transition, stop tracking events and call the finishInteractiveTransition or cancelInteractiveTransition method.

    Import Statement

    Swift

    import UIKit

    Availability

    Available in iOS 7.0 and later.

  • Notifies the system that user interactions canceled the transition.

    Declaration

    Swift

    func cancelInteractiveTransition()

    Objective-C

    - (void)cancelInteractiveTransition

    Discussion

    This is a convenience method that calls through to the cancelInteractiveTransition method of the context object.

    While tracking user interactions, your gesture recognizer or event-handling code would call this method when interactions suggest that the user wants to cancel or abort the view controller transition. For example, if the user reverses the swipe direction and then touch events end, suggesting that the user decided against the transition, you would call this method.

    Import Statement

    Swift

    import UIKit

    Availability

    Available in iOS 7.0 and later.

  • Notifies the system that user interactions signaled the completion of the transition.

    Declaration

    Swift

    func finishInteractiveTransition()

    Objective-C

    - (void)finishInteractiveTransition

    Discussion

    This is a convenience method that calls through to the finishInteractiveTransition method of the context object.

    While tracking user interactions, your gesture recognizer or event-handling code should call this methods when the interactions suggest that the transition is now complete. For example, if the user swipes a finger, and the touch events indicate that the swipe distance crossed the threshold needed to complete the gesture, call this method when the corresponding touch events end to let the system know that it can now complete the transition.

    Import Statement

    Swift

    import UIKit

    Availability

    Available in iOS 7.0 and later.