Last active
September 20, 2017 16:39
-
-
Save DejanEnspyra/e7b69d5d73c1cd57ec6bbf03bda26545 to your computer and use it in GitHub Desktop.
CleanSwift architecture - Router component
This file contains hidden or 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 | |
| protocol TestRouterInput { | |
| func showSomeVC() | |
| } | |
| class TestRouter: TestRouterInput | |
| { | |
| weak var viewController: ViewController! | |
| func showSomeVC() { | |
| viewController.performSegue(withIdentifier: "someVC", sender: nil) | |
| } | |
| // MARK: - Communication | |
| func passDataToNextScene(segue: UIStoryboardSegue) | |
| { | |
| // NOTE: Teach the router which scenes it can communicate with | |
| if segue.identifier == "someOtherVC" { | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment