Created
July 30, 2018 07:49
-
-
Save atanasovdejan/444d6d6f741688236d79aa3eafb1ef48 to your computer and use it in GitHub Desktop.
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 | |
@objc protocol TestRoutingLogic | |
{ | |
//func routeToSomewhere(segue: UIStoryboardSegue?) | |
} | |
protocol TestDataPassing | |
{ | |
var dataStore: TestDataStore? { get } | |
} | |
class TestRouter: NSObject, TestRoutingLogic, TestDataPassing | |
{ | |
weak var viewController: TestViewController? | |
var dataStore: TestDataStore? | |
// MARK: Routing | |
// func routeToSomewhere(segue: UIStoryboardSegue?) | |
// { | |
// if let segue = segue { | |
// let destinationVC = segue.destination as! SomewhereViewController | |
// var destinationDS = destinationVC.router!.dataStore! | |
// passDataToSomewhere(source: dataStore!, destination: &destinationDS) | |
// } else { | |
// let storyboard = UIStoryboard(name: "Main", bundle: nil) | |
// let destinationVC = storyboard.instantiateViewController(withIdentifier: "SomewhereViewController") as! SomewhereViewController | |
// var destinationDS = destinationVC.router!.dataStore! | |
// passDataToSomewhere(source: dataStore!, destination: &destinationDS) | |
// navigateToSomewhere(source: viewController!, destination: destinationVC) | |
// } | |
// } | |
// MARK: Navigation | |
// func navigateToSomewhere(source: TestViewController, destination: SomewhereViewController) | |
// { | |
// source.show(destination, sender: nil) | |
// } | |
// | |
// MARK: Passing data | |
// | |
// func passDataToSomewhere(source: TestDataStore, destination: inout SomewhereDataStore) | |
// { | |
// destination.name = source.name | |
// } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment