Sin Descripción

PresentExtension.swift 1.2KB

    // // PresentExtension.swift // PaiaiUIKit // // Created by ffib on 2019/1/25. // Copyright © 2019 yb. All rights reserved. // import Foundation public extension GestureRecognizerDelegate where Self: UIViewController & PresentAnimatorDelegate { func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool { if touch.view == view { return true } return false } } public extension ViewControllerTransitioningDelegate where Self: UIViewController & PresentAnimatorDelegate { func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { let transitioning = PresentDisappearAnimatedTransitioning(animator: animator) transitioning.delegate = self return transitioning } func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { let transitioning = PresentAppearAnimatedTransitioning(animator: animator) transitioning.delegate = self return transitioning } }