Skip to content

Instantly share code, notes, and snippets.

@DejanEnspyra
Last active September 20, 2017 16:39
Show Gist options
  • Select an option

  • Save DejanEnspyra/e7b69d5d73c1cd57ec6bbf03bda26545 to your computer and use it in GitHub Desktop.

Select an option

Save DejanEnspyra/e7b69d5d73c1cd57ec6bbf03bda26545 to your computer and use it in GitHub Desktop.
CleanSwift architecture - Router component
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