Wireframe
public protocol Wireframe : ControllerContainer
                Undocumented
- 
                  
                  
The top view controller currently used in your application
Declaration
Swift
var topViewController: UIViewController? { get } - 
                  
                  
dismiss the top view controller of your application
Declaration
Swift
func dismissTopViewController(animated:Bool, completion: @escaping ()->Void)Parameters
completioncompletion called after controller was dismissed
 - 
                  
                  
Check if a route pattern matching this url was added to the wireframe. Be careful, if you don’t route to a handler (but to a controller), it’s possible that no ControllerProvider or RoutingOptionProvider for this controller exists.
Declaration
Swift
func canRoute(url: URL, parameters: [String : Any], option: RoutingOption?) throws -> BoolParameters
urlthe url to check for resolution
parametersthe parameters (data) given to the controller
Return Value
Can the wireframe find a route for the given url
 - 
                  
                  
Route to a new route presenting a view controller
Throws
throws an error when no controller and/or option provider can be found.Declaration
Swift
func route(url: URL, parameters: [String : Any], option: RoutingOption?, completion: @escaping () -> Void) throwsParameters
urlthe route of the view controller to be presented
optionhow should your view controller be presented
parametersa dictionary of parameters (data) send to the presented view controller
completionfunction called when the view controller was presented
 - 
                  
                  
Return the view controller for a given url
Declaration
Swift
func controller(url: URL, parameters: [String : Any]) throws -> UIViewController?Parameters
urlurl
parametersparameters
Return Value
nil if no controller was found, the found controller otherwise
 - 
                  
                  
Register a route pattern for routing. You have to register a route pattern to allow the wireframe matching it. This is done automatically if you are using a ViewFeature from SwiftyVISPER as ControllerProvider.
Declaration
Swift
func add(routePattern: String) throwsParameters
patternthe route pattern to register
 - 
                  
                  
Register a handler for a route pattern The handler will be called if a route matches your route pattern. (you dont’t have to add your pattern manually in this case)
Declaration
Swift
func add(priority: Int, responsibleFor: @escaping (_ routeResult: RouteResult) -> Bool, handler: @escaping RoutingHandler) throwsParameters
priorityThe priority for calling your handler, higher priorities are called first. (Defaults to 0)
responsibleFornil if this handler should be registered for every routing option, or a spec
handlerA handler called when a route matches your route pattern
 - 
                  
                  
Add an instance providing a controller for a route
Declaration
Swift
func add(controllerProvider: ControllerProvider, priority: Int)Parameters
controllerProviderinstance providing a controller
priorityThe priority for calling your provider, higher priorities are called first. (Defaults to 0)
 - 
                  
                  
Add an instance providing routing options for a route
Declaration
Swift
func add(optionProvider: RoutingOptionProvider, priority: Int)Parameters
optionProviderinstance providing routing options for a route
priorityThe priority for calling your provider, higher priorities are called last. (Defaults to 0)
 - 
                  
                  
Add an instance providing a presenter for a route
Declaration
Swift
func add(presenterProvider: PresenterProvider, priority: Int)Parameters
providerinstance providing a presenter
priorityThe priority for calling your provider, higher priorities are called first. (Defaults to 0)
 - 
                  
                  
Add an instance observing controllers before they are presented
Declaration
Swift
func add(routingObserver: RoutingObserver, priority: Int, routePattern: String?)Parameters
routingObserverAn instance observing controllers before they are presented
priorityThe priority for calling your provider, higher priorities are called first. (Defaults to 0)
routePatternThe route pattern to call this observer, the observer is called for every route if this pattern is nil
 - 
                  
                  
Add an instance responsible for presenting view controllers. It will be triggert after the wireframe resolves a route
Declaration
Swift
func add(routingPresenter: RoutingPresenter, priority: Int)Parameters
routingPresenterAn instance responsible for presenting view controllers
priorityThe priority for calling your provider, higher priorities are called first. (Defaults to 0)
 - 
                  
                  
Add a instance responsible for finding the top view controller on an other vc
Declaration
Swift
func add(topControllerResolver: TopControllerResolver, priority: Int)Parameters
topControllerResolverinstance responsible for finding the top view controller on an other vc
priorityThe priority for calling your resolver, higher priorities are called first. (Defaults to 0)
 - 
                  
                  
Add an instance responsible for dismissing controllers
Declaration
Swift
func add(controllerDimisser: ControllerDismisser, priority: Int)Parameters
controllerDimisseran instance responsible for dismissing controllers
priorityThe priority for calling your dismisser, higher priorities are called first. (Defaults to 0)
 - 
                  
                  
Add a controller that can be used to navigate in your app. Typically this will be a UINavigationController, but it could also be a UITabbarController if you have a routing presenter that can handle it. Be careful you can add more than one viewControllers if your RoutingPresenters can handle different controller types or when the active ‘rootController’ changes. The last added controller will be used first. The controller will not be retained by the application (it is weakly stored), you need to store a link to them elsewhere (if you don’t want them to be removed from memory).
Declaration
Swift
func navigateOn(_ controller: UIViewController)Parameters
controllera controller that can be used to navigte in your app
 - 
                  
                  
return the first navigatableController that matches in a block
Declaration
Swift
func controllerToNavigate(matches: (_ controller: UIViewController?) -> Bool) -> UIViewController? 
- 
                  
add(controllerToNavigate:)Extension methodUndocumented
Declaration
Swift
public func add(controllerToNavigate: UIViewController) - 
                  
canRoute(url:)Extension methodUndocumented
Declaration
Swift
public func canRoute(url: URL) throws -> Bool - 
                  
canRoute(url:parameters:)Extension methodUndocumented
Declaration
Swift
public func canRoute( url: URL, parameters: [String : Any]) throws -> Bool - 
                  
canRoute(url:option:)Extension methodUndocumented
Declaration
Swift
public func canRoute( url: URL, option: RoutingOption?) throws -> Bool - 
                  
route(url:)Extension methodUndocumented
Declaration
Swift
public func route(url: URL) throws - 
                  
route(url:option:completion:)Extension methodUndocumented
Declaration
Swift
public func route(url: URL, option: RoutingOption?, completion: @escaping () -> Void = {}) throws - 
                  
route(url:parameters:completion:)Extension methodUndocumented
Declaration
Swift
public func route(url: URL, parameters: [String : Any], completion: @escaping () -> Void = {}) throws - 
                  
route(route:parameters:option:completion:)Extension methodUndocumented
Declaration
Swift
public func route(route: String, parameters: [String : Any] = [:], option: RoutingOption? = nil, completion: @escaping () -> Void = {}) throws - 
                  
controller(url:)Extension methodUndocumented
Declaration
Swift
public func controller(url: URL) throws -> UIViewController? - 
                  
add(responsibleFor:handler:)Extension methodUndocumented
Declaration
Swift
public func add(responsibleFor: @escaping (_ routeResult: RouteResult) -> Bool, handler: @escaping RoutingHandler) throws - 
                  
add(controllerProvider:)Extension methodUndocumented
Declaration
Swift
public func add(controllerProvider: ControllerProvider) - 
                  
add(optionProvider:)Extension methodUndocumented
Declaration
Swift
public func add(optionProvider: RoutingOptionProvider) - 
                  
add(routingObserver:routePattern:)Extension methodUndocumented
Declaration
Swift
public func add(routingObserver: RoutingObserver, routePattern: String?) - 
                  
add(routingObserver:priority:)Extension methodUndocumented
Declaration
Swift
public func add(routingObserver: RoutingObserver, priority: Int = 0) - 
                  
add(routingPresenter:)Extension methodUndocumented
Declaration
Swift
public func add(routingPresenter: RoutingPresenter) - 
                  
addUnretained(controller:)Extension methodUndocumented
Declaration
Swift
public func addUnretained(controller: UIViewController) - 
                  
remove(controller:)Extension methodUndocumented
Declaration
Swift
public func remove(controller: UIViewController) - 
                  
getController(matches:)Extension methodUndocumented
Declaration
Swift
public func getController(matches: (_ controller: UIViewController?) -> Bool) -> UIViewController? 
View on GitHub
        Wireframe Protocol Reference