VISPERApp

open class VISPERApp<AppState> : VISPERAppType, ReduxApp, WireframeApp

A SwiftyVisper application, containing all dependencies which should be configured by features

  • Undocumented

    Declaration

    Swift

    public typealias ApplicationObservableProperty = ObservableProperty<AppState>
  • Undocumented

    Declaration

    Swift

    public init(reduxApp: AnyReduxApp<AppState>,
            wireframeApp: WireframeApp)
  • Undocumented

    Declaration

    Swift

    public convenience init(reduxApp: AnyReduxApp<AppState>,
                           wireframe: Wireframe,
                 controllerContainer: ControllerContainer)
  • Undocumented

    Declaration

    Swift

    public convenience init(redux: Redux<AppState>,
                        wireframe: Wireframe,
              controllerContainer: ControllerContainer)
  • observable app state property

    Declaration

    Swift

    open var state: ObservableProperty<AppState> { get }
  • the wireframe responsible for routing between your view controllers

    Declaration

    Swift

    public var wireframe: Wireframe { get }
  • Declaration

    Swift

    public var redux: Redux<AppState> { get }
  • Add a feature to your application

    Throws

    throws errors thrown by your feature observers

    Note

    A Feature is an empty protocol representing a distinct funtionality of your application. It will be provided to all FeatureObservers after addition to configure and connect it to your application and your remaining features. Have look at LogicFeature and LogicFeatureObserver for an example.

    Declaration

    Swift

    open func add(feature: Feature) throws

    Parameters

    feature

    your feature

  • Add an observer to configure your application after adding a feature. Have look at LogicFeature and LogicFeatureObserver for an example.

    Declaration

    Swift

    open func add<T>(featureObserver: T) where AppState == T.AppState, T : StatefulFeatureObserver

    Parameters

    featureObserver

    an object observing feature addition

  • Add an observer to configure your application after adding a feature. Have look at LogicFeature and LogicFeatureObserver for an example.

    Declaration

    Swift

    open func add(featureObserver: FeatureObserver)

    Parameters

    featureObserver

    an object observing feature addition

  • Add an observer to configure your application after adding a feature. Have look at LogicFeature and LogicFeatureObserver for an example.

    Declaration

    Swift

    public func add(featureObserver: WireframeFeatureObserver)

    Parameters

    featureObserver

    an object observing feature addition

  • 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

    open func navigateOn(_ controller: UIViewController)

    Parameters

    controller

    a controller that can be used to navigte in your app

  • return the first navigatableController that matches in a block

    Declaration

    Swift

    public func controllerToNavigate(matches: (UIViewController?) -> Bool) -> UIViewController?