---
title: ViewAnnotation
framework: appintentstesting
role: symbol
role_heading: Structure
path: appintentstesting/viewannotation
---

# ViewAnnotation

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

## Declaration

```swift
struct ViewAnnotation
```

## Mentioned in

Testing your App Intents code

## Overview

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(), then inspect their selection state and which entities are visible on-screen.

## Topics

### Accessing onscreen context

- [entity](appintentstesting/viewannotation/entity.md)
- [isSelected](appintentstesting/viewannotation/isselected.md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
