123456789101112131415161718192021222324252627282930313233343536 |
- import UIKit
- 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
- }
- }
|