class UserProfileViewController: UIViewController, DataReceivingViewController {
typealias DataType = User
func didReceiveData(_ data: User) {
// configure UI with data
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 Foundation | |
| import ARoute | |
| protocol Route { | |
| var path: String { get } | |
| var registrationPath: String { get } | |
| var redirectRoute: Route { get } | |
| func getViewController(parameters: [String: Any]?, embeddingType: RouteEmbeddingType?) -> UIViewController? | |
| func getEmbeddingViewController(parameters: [String : Any]?, embeddingType: RouteEmbeddingType?) -> UIViewController? | |
| func map(parameters: [String: Any]?, embeddingType: RouteEmbeddingType?) -> ARouteRequestExecutable |
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 Foundation | |
| import ARoute | |
| protocol RouteProvider { | |
| var router: ARoute { get } | |
| var routes: [String: ARoutable.Type] { get } | |
| var protectedRoutes: [Route] { get } | |
| func open(route: Route, transitionType: RouteTransitionType, animated: Bool, parameters: [String: Any]?, embeddingType: RouteEmbeddingType?) | |
| } |
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 | |
| import ARoute | |
| final class HomeViewController: UIViewController, ARoutable { | |
| required init?(coder aDecoder: NSCoder) { | |
| super.init(coder: aDecoder) | |
| } | |
| required init?(routeResponse: ARouteResponse) { | |
| super.init(nibName: nil, bundle: nil) |
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 Foundation | |
| import ARoute | |
| enum RouteEmbeddingType { | |
| case navigationController | |
| case tabBarController | |
| } |
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 Foundation | |
| import ARoute | |
| enum RouteTransitionType { | |
| case pushWithDelegate(navigationControllerDelegate: UINavigationControllerDelegate) | |
| case push | |
| case modal | |
| case custom(transitioningDelegate: UIViewControllerTransitioningDelegate) | |
| func performTransition(routeRequest: ARouteRequestExecutable) { |
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
| extension Array { | |
| func flattened<T>() -> [T] where Element == T? { | |
| return flatMap { $0 } | |
| } | |
| } | |
| let array: [String?] = [ | |
| "gimme", | |
| "some", | |
| nil, |
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 CoreNavigation | |
| struct PersonProfile: Destination { | |
| typealias ViewControllerType = PersonProfileViewController | |
| let personId: String | |
| init(_ personId: String) { | |
| self.personId = personId | |
| } |
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 CoreNavigation | |
| class PersonProfileViewController: UIViewController, DataReceivable { | |
| // DataReceivable associatedtype | |
| typealias DataType = Person | |
| func didReceiveData(_ data: Person) { | |
| // configure UI with data | |
| } |
OlderNewer