Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct PresentTransition: RouteTransition {
- let route: Route
- let routeWrapper: RouteWrapper?
- let presentationStyle: UIModalPresentationStyle
- init(route: Route, embedIn routeWrapper: RouteWrapper? = nil, presentationStyle: UIModalPresentationStyle = .fullScreen) {
- self.route = route
- self.routeWrapper = routeWrapper
- self.presentationStyle = presentationStyle
- }
- func execute(with vc: UIViewController, using resolver: RouteResolver, animated: Bool) {
- guard strategy.prepareForTransition(from: vc, to: route) else { return }
- let destination = routeWrapper?.wrapRoute(route, using: resolver) ?? route.prepare(using: resolver)
- destination.modalPresentationStyle = presentationStyle
- destination.popoverPresentationController?.sourceView = vc.view
- vc.present(destination, animated: animated)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement