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) -> CaravelParameters
subscriberSubscriber (usually the view controller)
webViewWebView to watch
whenReadyAction 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) -> CaravelParameters
subscriberSubscriber (usually the view controller)
webViewWebView to watch
whenReadyOnMainAction 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) -> CaravelParameters
subscriberSubscriber (usually the view controller)
nameBus name
webViewWebView to watch
whenReadyAction 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) -> CaravelParameters
subscriberSubscriber (usually the view controller)
nameBus name
webViewWebView to watch
whenReadyOnMainAction 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.DraftParameters
configurationCustom 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) -> CaravelParameters
subscriberSubscriber (usually the view controller)
wkWebViewWKWebView to watch
draftEventBus draft that has been built before initializing the view
whenReadyAction 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) -> CaravelParameters
subscriberSubscriber (usually the view controller)
wkWebViewWKWebView to watch
draftEventBus draft that has been built before initializing the view
whenReadyOnMainAction 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) -> CaravelParameters
subscriberSubscriber (usually the view controller)
nameBus name
wkWebViewWKWebView to watch
draftEventBus draft that has been built before initializing the view
whenReadyAction 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) -> CaravelParameters
subscriberSubscriber (usually the view controller)
nameBus name
wkWebViewWKWebView to watch
draftEventBus draft that has been built before initializing the view
whenReadyOnMainAction to run when bus is ready to use
Return Value
Current instance
View on GitHub
Install in Dash
Caravel Class Reference