---
title: "init(isPresented:onSelect:)"
framework: spatialpreview
role: symbol
role_heading: Initializer
path: "spatialpreview/spatialpreviewdevicepicker/init(ispresented:onselect:)"
---

# init(isPresented:onSelect:)

Creates a device picker.

## Declaration

```swift
@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.
