<!--
{
  "availability" : [
    "macOS: 27.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "SpatialPreview",
  "identifier" : "/documentation/SpatialPreview/ConnectedSpatialEndpointObserver",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Spatial Preview"
    ],
    "preciseIdentifier" : "s:14SpatialPreview09ConnectedA16EndpointObserverC"
  },
  "title" : "ConnectedSpatialEndpointObserver"
}
-->

# ConnectedSpatialEndpointObserver

An observer that provides access to the endpoint for a device connected via Mac Virtual Display.

```
@MainActor final class ConnectedSpatialEndpointObserver
```

## Overview

You can choose to discover another device using [`SpatialPreviewDevicePicker`](/documentation/SpatialPreview/SpatialPreviewDevicePicker).

## Topics

### Structures

[`struct UnavailableError`](/documentation/SpatialPreview/ConnectedSpatialEndpointObserver/UnavailableError)

An error thrown when accessing the [`endpoint`](/documentation/SpatialPreview/ConnectedSpatialEndpointObserver/endpoint) property while no Mac Virtual Display device is available.

### Initializers

[`init()`](/documentation/SpatialPreview/ConnectedSpatialEndpointObserver/init())

Creates a new observer for monitoring connected device endpoint availability.

### Instance Properties

[`var endpoint: SpatialPreviewEndpoint`](/documentation/SpatialPreview/ConnectedSpatialEndpointObserver/endpoint)

The endpoint for the visionOS device currently connected via Mac Virtual Display.

[`var isEndpointAvailable: Bool`](/documentation/SpatialPreview/ConnectedSpatialEndpointObserver/isEndpointAvailable)

Indicates whether a connected device endpoint is currently connected.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`Escapable`](/documentation/Swift/Escapable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Observable`](/documentation/Observation/Observable)

[`Copyable`](/documentation/Swift/Copyable)

---

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)