BridgeViewDelegate
public protocol BridgeViewDelegate : AnyObject
Event-handlers for BridgeView.
-
Called whenever the view attempts to navigate to another page.
Should likely be handled by pushing a new view-controller wrapping a
BridgeViewto the navigation-stack.Declaration
Swift
func bridgeView(_ bridgeView: BridgeView, navigatedTo page: Page)Parameters
bridgeViewCalling view.
pagePage to navigate to.
-
Called whenever the view attempts to go back.
Should likely be handled by popping the current view-controller from the stack.
Declaration
Swift
func bridgeViewDidSelectBack(_ bridgeView: BridgeView)Parameters
bridgeViewCalling view.
-
bridgeView(_:Default implementationchangedStatusTo: ) Called whenever the view changes status. It is not necessary to react to this.
Can be used to implement a custom loading-screen by hiding the loading-screen and showing the view on a change to
runningorerrored.Can be used to implement a custom error-screen by hiding the view and showing an error page on a change to
errored.Default Implementation
Declaration
Swift
func bridgeView(_ bridgeView: BridgeView, changedStatusTo status: ViewStatus)Parameters
bridgeViewCalling view.
statusNew status of the view.
-
bridgeView(_:Default implementationupdatedTitleTo: ) Called whenever the view changes title.
If a host-application controlled title-bar is used, this text should be shown there.
Default Implementation
Declaration
Swift
func bridgeView(_ bridgeView: BridgeView, updatedTitleTo title: String?)Parameters
bridgeViewCalling view.
titleTitle of the view.
-
Called whenever the view receives an error.
noTemplateandviewTimedOutshould be handled by showing an error page.Declaration
Swift
func bridgeView(_ bridgeView: BridgeView, didReceiveError error: ViewError)Parameters
bridgeViewCalling view.
errorThe error that the view received.
-
bridgeView(_:Default implementationresizedTo: ) Called whenever the content of the view resizes. This event is only called if
reportResizeis set to true in theBridgeViewconstructor.Default Implementation
Declaration
Swift
func bridgeView(_ bridgeView: BridgeView, resizedTo height: Int)Parameters
bridgeViewCalling view.
heightThe height in device-independent pixels
-
bridgeView(_:Default implementationreceivedCustomEvent: data: ) Called when a custom event is sent. Custom event names and payloads should be agreed upon between host and embedded app.
Default Implementation
Declaration
Swift
func bridgeView(_ bridgeView: BridgeView, receivedCustomEvent name: String, data: Any?)Parameters
bridgeViewCalling view.
nameThe name of the event.
dataVaries depending on the name.
BridgeViewDelegate Protocol Reference