DevicePickerSupportedAction
An environment value that indicates whether the current device supports device discovery.
Declaration
struct DevicePickerSupportedActionOverview
Access the action using the .devicePickerSupports key. Then call it as a function, passing the same browse descriptor and parameters you use to search for devices.
struct SettingsView: View {
@Environment{\.devicePickerSupports} var myDevicePickerSupports
@Binding var showDevicePicker: Bool
var body: some View {
if myDevicePickerSupports(.applicationService("MyAppService"),
parameters: { .applicationService }) {
Button("Select A Device") {
// Display a device picker.
showDevicePicker = true
}
}
}
}