Created
November 19, 2020 06:27
-
-
Save brunomunizaf/9d32e64bb81a21dc5362821d1e0a3741 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
final class Presenter: NSObject, UIViewControllerTransitioningDelegate { | |
private let transition = Transition() | |
func present(_ viewController: UIViewController, from parent: UIViewController) { | |
viewController.modalPresentationStyle = .overFullScreen | |
viewController.transitioningDelegate = self | |
parent.present(viewController, animated: true) | |
} | |
func animationController(forPresented presented: UIViewController, | |
presenting: UIViewController, | |
source: UIViewController) -> UIViewControllerAnimatedTransitioning? { | |
transition.direction = .present | |
return transition | |
} | |
func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { | |
transition.direction = .dismiss | |
return transition | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment