Caravel

public class Caravel

Caravel

Main class of the library. Dispatches events among buses.

  • Current name

    Declaration

    Swift

    public var name: String
  • Returns default bus

    Declaration

    Swift

    public static func getDefault(subscriber: AnyObject, webView: UIWebView, whenReady: (EventBus) -> Void) -> Caravel

    Parameters

    subscriber

    Subscriber (usually the view controller)

    webView

    WebView to watch

    whenReady

    Action to run when bus is ready to use

    Return Value

    Current instance

  • Returns default bus and runs callback on main thread

    Declaration

    Swift

    public static func getDefault(subscriber: AnyObject, webView: UIWebView, whenReadyOnMain: (EventBus) -> Void) -> Caravel

    Parameters

    subscriber

    Subscriber (usually the view controller)

    webView

    WebView to watch

    whenReadyOnMain

    Action to run when bus is ready to use

    Return Value

    Current instance

  • Returns custom bus

    Declaration

    Swift

    public static func get(subscriber: AnyObject, name: String, webView: UIWebView, whenReady: (EventBus) -> Void) -> Caravel

    Parameters

    subscriber

    Subscriber (usually the view controller)

    name

    Bus name

    webView

    WebView to watch

    whenReady

    Action to run when bus is ready to use

    Return Value

    Current instance

  • Returns custom bus and runs callback on main thread

    Declaration

    Swift

    public static func get(subscriber: AnyObject, name: String, webView: UIWebView, whenReadyOnMain: (EventBus) -> Void) -> Caravel

    Parameters

    subscriber

    Subscriber (usually the view controller)

    name

    Bus name

    webView

    WebView to watch

    whenReadyOnMain

    Action to run when bus is ready to use

    Return Value

    Current instance

  • Builds draft for single use with provided WKWebView configuration

    Declaration

    Swift

    public static func getDraft(configuration: WKWebViewConfiguration) -> EventBus.Draft

    Parameters

    configuration

    Custom WKWebView configuration

    Return Value

    Bus draft

  • Returns default bus

    Declaration

    Swift

    public static func getDefault(subscriber: AnyObject, wkWebView: WKWebView, draft: EventBus.Draft, whenReady: (EventBus) -> Void) -> Caravel

    Parameters

    subscriber

    Subscriber (usually the view controller)

    wkWebView

    WKWebView to watch

    draft

    EventBus draft that has been built before initializing the view

    whenReady

    Action to run when bus is ready to use

    Return Value

    Current instance

  • Returns default bus and runs callback on main thread

    Declaration

    Swift

    public static func getDefault(subscriber: AnyObject, wkWebView: WKWebView, draft: EventBus.Draft, whenReadyOnMain: (EventBus) -> Void) -> Caravel

    Parameters

    subscriber

    Subscriber (usually the view controller)

    wkWebView

    WKWebView to watch

    draft

    EventBus draft that has been built before initializing the view

    whenReadyOnMain

    Action to run when bus is ready to use

    Return Value

    Current instance

  • Returns default bus

    Declaration

    Swift

    public static func get(subscriber: AnyObject, name: String, wkWebView: WKWebView, draft: EventBus.Draft, whenReady: (EventBus) -> Void) -> Caravel

    Parameters

    subscriber

    Subscriber (usually the view controller)

    name

    Bus name

    wkWebView

    WKWebView to watch

    draft

    EventBus draft that has been built before initializing the view

    whenReady

    Action to run when bus is ready to use

    Return Value

    Current instance

  • Returns default bus and runs callback on main thread

    Declaration

    Swift

    public static func get(subscriber: AnyObject, name: String, wkWebView: WKWebView, draft: EventBus.Draft, whenReadyOnMain: (EventBus) -> Void) -> Caravel

    Parameters

    subscriber

    Subscriber (usually the view controller)

    name

    Bus name

    wkWebView

    WKWebView to watch

    draft

    EventBus draft that has been built before initializing the view

    whenReadyOnMain

    Action to run when bus is ready to use

    Return Value

    Current instance