<!--
{
  "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/init(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Siri Evaluations"
    ],
    "preciseIdentifier" : "s:15SiriEvaluations8OnScreenVyACSay17AppIntentsTesting010ResolvableE17EntityExpectation_pGyXEcfc"
  },
  "title" : "init(_:)"
}
-->

# init(_:)

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

```
init(@OnScreenEntityExpectationBuilder _ content: () -> [any ResolvableAppEntityExpectation])
```

## Discussion

Onscreen entities are identity-based. A staged view shows entities the author already knows,
so property matching is not offered here. For property-based matching of search results, see
[`Finds`](/documentation/SiriEvaluations/Finds).

The following shows how you can use the builder syntax:

```swift
OnScreen {
    EventEntity.expectIdentifier("An identifier")
}
```

---

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)