<!--
{
  "availability" : [
    "iOS: 27.3.0 -",
    "iPadOS: 27.3.0 -",
    "macOS: 27.3.0 -",
    "visionOS: 27.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SiriEvaluations",
  "identifier" : "/documentation/SiriEvaluations/OnScreen",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Siri Evaluations"
    ],
    "preciseIdentifier" : "s:15SiriEvaluations8OnScreenV"
  },
  "title" : "OnScreen"
}
-->

# OnScreen

An expectation that specific app entities are onscreen.

```
struct OnScreen
```

## Overview

Use `OnScreen` to check that an entity is in the onscreen context Siri captures
for a turn. `OnScreen` doesn’t show the entity itself, so before the evaluation
runs, make sure your app is displaying it. For example, run an App Intent that
opens the screen that shows the entity and then run the evaluation.

Unlike [`Finds`](/documentation/SiriEvaluations/Finds), `OnScreen` matches by identity only and doesn’t use property
constraints like `.expect(title:)`. Write an empty entity
definition to match any entity of that type, or call
<doc://com.apple.documentation/documentation/AppIntentsTesting/AppEntityDefinition/expectIdentifier(_:)>
to name a specific one.

The following example shows a turn that expects a specific quiz topic to be
onscreen:

```swift
let quizExampleIntents = IntentDefinitions(bundleIdentifier: "com.example.QuizExample")
let quizTopicEntity = quizExampleIntents.entities["QuizTopicEntity"]

// The app is already showing the topic list.
UserTurn("Which quizzes are available in QuizExample?") {
    OnScreen {
        quizTopicEntity.expectIdentifier("Science")
    }
}
```

## Topics

### Creating an onscreen expectation

[`init(() -> [any ResolvableAppEntityExpectation])`](/documentation/SiriEvaluations/OnScreen/init(_:))

Creates an expectation that each entity in the block is onscreen.

[`enum OnScreenEntityExpectationBuilder`](/documentation/SiriEvaluations/OnScreenEntityExpectationBuilder)

A result builder that collects the entities an onscreen expectation requires.

## Relationships

### Conforms To

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

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

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

[`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)