Contents

init(_:access:onSelect:label:fallback:parameters:)

Creates a view that displays the available devices with the access level, section handler, and other parameters you supply.

Declaration

@MainActor @preconcurrency init<Provider>(_ browserProvider: Provider, access: DDDevicePairingAccess = .default, onSelect: @escaping (Provider.Endpoint) -> Void, @ViewBuilder label: () -> Label, @ViewBuilder fallback: () -> Fallback, parameters: (() -> NWParameters)? = nil) where Provider : BrowserProvider

Parameters

  • browserProvider:

    An object that conforms to the Browserprovider protocol and implements a specific network browser type.

  • access:

    The Dddevicepairingaccess access level. The default is DDDevicePairingAccess.default.

  • onSelect:

    A closure that the framework calls when someone selects a device in the picker view, or cancels the view.

  • label:

    A label the network device picker displays.

  • fallback:

    A view that the framework displays if the current device doesn’t support device discovery.

  • parameters:

    Parameters for your network connection. Use Applicationservice to create a default set of parameters that create an encrypted connection with the other devices. You can also add a Nwprotocolframer to provide an application-level messaging protocol.

See Also

Creating a device picker