<!--
{
  "availability" : [
    "macOS: 27.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "SpatialPreview",
  "identifier" : "/documentation/SpatialPreview/SpatialPreviewDevicePicker/init(isPresented:onSelect:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Spatial Preview",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:23_SpatialPreview_SwiftUI0aB12DevicePickerV11isPresented8onSelectAC0cD07BindingVySbG_y0aB00aB8EndpointVctcfc"
  },
  "title" : "init(isPresented:onSelect:)"
}
-->

# init(isPresented:onSelect:)

Creates a device picker.

```
@MainActor @preconcurrency init(isPresented: Binding<Bool>, onSelect: @escaping (SpatialPreviewEndpoint) -> Void)
```

## Parameters

`isPresented`

A binding to a Boolean that determines whether the picker view is displayed

`onSelect`

When a device is selected the `SpatialPreviewEndpoint` for that device will be returned.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)