DeckTransitioningDelegate
public final class DeckTransitioningDelegate: NSObject, UIViewControllerTransitioningDelegate
                The DeckTransitioningDelegate class vends out the presentation and animation controllers required to present a view controller with the Deck transition style
The following snippet described the steps for presenting a given
ModalViewController with the DeckTransitioningDelegate
let modal = ModalViewController()
let transitionDelegate = DeckTransitioningDelegate()
modal.transitioningDelegate = transitionDelegate
modal.modalPresentationStyle = .custom
present(modal, animated: true, completion: nil)
          - 
                  
init(isSwipeToDismissEnabled:presentDuration:presentAnimation:presentCompletion:dismissDuration:dismissAnimation:dismissCompletion:)Returns a transitioning delegate to perform a Deck transition. All parameters are optional. Swipe-to-dimiss is enabled by default. Leaving the duration parameters empty gives you animations with the default durations (0.3s for both)
Declaration
Swift
@objc public init(isSwipeToDismissEnabled: Bool = true, presentDuration: NSNumber? = nil, presentAnimation: (() -> ())? = nil, presentCompletion: ((Bool) -> ())? = nil, dismissDuration: NSNumber? = nil, dismissAnimation: (() -> ())? = nil, dismissCompletion: ((Bool) -> ())? = nil)Parameters
isSwipeToDismissEnabledWhether the modal view controller should be dismissed with a swipe gesture from top to bottom
presentDurationThe duration for the presentation animation
presentAnimationAn animation block that will be performed alongside the card presentation animation
presentCompletionA block that will be run after the card has been presented
dismissDurationThe duration for the dismissal animation
dismissAnimationAn animation block that will be performed alongside the card dismissal animation
dismissCompletionA block that will be run after the card has been dismissed
 
- 
                  
                  
Returns an animation controller that animates the modal presentation
This is internal infrastructure handled entirely by UIKit and shouldn’t be called directly
Declaration
Swift
public func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning?Parameters
presentedThe modal view controller to be presented onscreen
presentingThe view controller that will be presenting the modal
sourceThe view controller whose
presentmethod is calledReturn Value
An animation controller that animates the modal presentation
 - 
                  
                  
Returns an animation controller that animates the modal dismissal
This is internal infrastructure handled entirely by UIKit and shouldn’t be called directly
Declaration
Swift
public func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning?Parameters
dismissedThe modal view controller which will be dismissed
Return Value
An animation controller that animates the modal dismisall
 - 
                  
                  
Returns a presentation controller that manages the modal presentation
This is internal infrastructure handled entirely by UIKit and shouldn’t be called directly
Declaration
Swift
public func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController?Parameters
presentedThe modal view controller
presentingThe view controller which presented the modal
sourceThe view controller whose
presentmethod was called to present the modalReturn Value
A presentation controller that manages the modal presentation
 
View on GitHub
Install in Dash
        DeckTransitioningDelegate Class Reference