---
title: viewAnnotations()
framework: appintentstesting
role: symbol
role_heading: Instance Method
path: appintentstesting/appentitydefinition/viewannotations()
---

# viewAnnotations()

Provides the currently visible onscreen entities.

## Declaration

```swift
func viewAnnotations() async throws -> [ViewAnnotation]
```

## Mentioned in

Testing your App Intents code

## Return Value

Return Value An array of view annotations, with selection state and entity data.

## Discussion

Discussion note: An error if the view annotations query fails.
