Contents

init(_:access:label:fallback:)

Creates a DevicePairingView which, when pressed, will display a local device advertiser interface.

Declaration

@MainActor @preconcurrency init(_ listenerProvider: any ListenerProvider, access: DDDevicePairingAccess = .default, @ViewBuilder label: () -> Label, @ViewBuilder fallback: () -> Fallback)

Parameters

  • listenerProvider:

    A ListenerProvider which provides information about the listener to use to advertise.

  • access:

    The level of access the app receives for the endpoint selected by the user.

  • label:

    A view that describes the action of requesting device advertising if it is supported.

  • fallback:

    A view that describes the alternative action when device advertising is not supported.

Discussion

For example:

DevicePairingView(listenerProvider) {
	Text("Starting advertising to local devices")
} fallback: {
	Text("Advertising not available")
}