Last active
July 26, 2019 19:27
-
-
Save aronbalog/29b69c25c4ac220dab95bf6bbca17e04 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 Foundation | |
import ARoute | |
enum RouteTransitionType { | |
case pushWithDelegate(navigationControllerDelegate: UINavigationControllerDelegate) | |
case push | |
case modal | |
case custom(transitioningDelegate: UIViewControllerTransitioningDelegate) | |
func performTransition(routeRequest: ARouteRequestExecutable) { | |
switch self { | |
case .push: | |
routeRequest.push() | |
case .modal: | |
routeRequest.execute() | |
case .custom(let transitioningDelegate): | |
(routeRequest as! ARouteRequestConfigurable).transitioningDelegate { transitioningDelegate } | |
.execute() | |
case .pushWithDelegate(let navigationControllerDelegate): | |
routeRequest.push({ navigationControllerDelegate }, routeResponse: nil) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment