Finder

public protocol Finder

An instance that conforms to the Finder protocol will be used by the Router to find out if some UIViewController instance is integrated into the view controller stack

Associated types

  • Type of UIViewController that Finder can find

    Declaration

    Swift

    associatedtype ViewController : UIViewController
  • Type of Context object that Finder can deal with

    Declaration

    Swift

    associatedtype Context

Methods to implement

  • Returns the view controller instance if it is present in the stack.

    Declaration

    Swift

    func findViewController(with context: Context) throws -> ViewController?

    Parameters

    context

    The Context instance passed to the Router.

    Return Value

    The UIViewController instance that the Router is looking for, nil otherwise.

Helper methods

  • getViewController(with:) Extension method

    Returns the view controller instance if it is present in the stack. Doesn’t throw any exceptions in case the search can not be performed.

    Declaration

    Swift

    func getViewController(with context: Context) -> ViewController?

    Parameters

    context

    The Context instance passed to the Router.

    Return Value

    The UIViewController instance that the Router is looking for, nil otherwise.

Available where Context == Any?

  • findViewController() Extension method

    Returns the view controller instance if it is present in the stack.

    Declaration

    Swift

    func findViewController() throws -> ViewController?

    Return Value

    The UIViewController instance that the Router is looking for, nil otherwise.

  • getViewController() Extension method

    Returns the view controller instance if it is present in the stack. Doesn’t throw any exceptions in case the search can not be performed.

    Declaration

    Swift

    func getViewController() -> ViewController?

    Return Value

    The UIViewController instance that the Router is looking for, nil otherwise.

Available where Context == Void

  • findViewController() Extension method

    Returns the view controller instance if it is present in the stack.

    Declaration

    Swift

    func findViewController() throws -> ViewController?

    Return Value

    The UIViewController instance that the Router is looking for, nil otherwise.

  • getViewController() Extension method

    Returns the view controller instance if it is present in the stack. Doesn’t throw any exceptions in case the search can not be performed.

    Declaration

    Swift

    func getViewController() -> ViewController?

    Return Value

    The UIViewController instance that the Router is looking for, nil otherwise.