<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntentsTesting",
  "identifier" : "/documentation/AppIntentsTesting/ViewAnnotation",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "App Intents Testing"
    ],
    "preciseIdentifier" : "s:17AppIntentsTesting14ViewAnnotationV"
  },
  "title" : "ViewAnnotation"
}
-->

# ViewAnnotation

The onscreen context you provide to the system by annotating a view with an app entity.

```
struct ViewAnnotation
```

## Overview

Use the `ViewAnnotation` structure to test whether the currently visible user interface and its views have the expected
entity view annotations you created to provide onscreen context to the system. Retrieve visible view annotations using [`viewAnnotations()`](/documentation/AppIntentsTesting/AppEntityDefinition/viewAnnotations()), then inspect their selection state and which entities are visible on-screen.

## Topics

### Accessing onscreen context

[`let entity: AnyAppEntity`](/documentation/AppIntentsTesting/ViewAnnotation/entity)

The underlying app entity data.

[`let isSelected: Bool`](/documentation/AppIntentsTesting/ViewAnnotation/isSelected)

A Boolean value that indicates whether the entity’s associated view is selected.

## Relationships

### Conforms To

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

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

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

---

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)