<!--
{
  "availability" : [
    "iOS: 18.4.0 -",
    "iPadOS: 18.4.0 -",
    "macCatalyst: -",
    "macOS: 15.4.0 -",
    "tvOS: 18.4.0 -",
    "visionOS: 2.4.0 -",
    "watchOS: 11.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntents",
  "identifier" : "/documentation/AppIntents/AppEntityUIElement",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "App Intents"
    ],
    "preciseIdentifier" : "s:10AppIntents0A15EntityUIElementV"
  },
  "title" : "AppEntityUIElement"
}
-->

# AppEntityUIElement

A type that wraps your app entity and adds information to make a custom view’s content discoverable by Apple Intelligence.

```
struct AppEntityUIElement
```

## Overview

A custom view where your app manages state for the user interface or you use custom drawing
to render the interface. For example, you might use a custom
list or tab implementation and manage selection and other states in the app, or you might use Metal to render the interface.
If either applies to your
app’s interface, make content discoverable by Apple Intelligence using `appEntityUIElementProvider` and provide the system
with a list of `AppEntityUIElements`.

When your app uses a custom view and your app manages its state or you use custom drawing
to render a UI element, you need to implement your own `appEntityUIElementProvider`. This closure provides the system with
`AppEntityUIElement` objects that combine the app entity for your content and additional information with spatial and state information
to help the system understand onscreen content.

For more information, refer to <doc:providing-contextual-cues-to-Apple-Intelligence-and-Siri> and
<doc://com.apple.documentation/documentation/AppIntents>.

## Topics

### Structures

[`struct State`](/documentation/AppIntents/AppEntityUIElement/State-swift.struct)

The current UI state of the entity that’s visible onscreen.

### Initializers

[`init<Entity>(Entity, bounds: CGRect, state: AppEntityUIElement.State, subelements: [AppEntityUIElement])`](/documentation/AppIntents/AppEntityUIElement/init(_:bounds:state:subelements:))

Creates a wrapper object that combines an app entity with additional information to make it discoverable
by Apple Intelligence and Siri.

[`init(identifier: EntityIdentifier, bounds: CGRect, state: AppEntityUIElement.State, subelements: [AppEntityUIElement])`](/documentation/AppIntents/AppEntityUIElement/init(identifier:bounds:state:subelements:))

Creates a wrapper object that combines an app entity with additional information to make it discoverable
by Apple Intelligence and Siri.

### Instance Properties

[`var bounds: CGRect`](/documentation/AppIntents/AppEntityUIElement/bounds)

The bounds of the content in the view’s local coordinate space.

[`var identifier: EntityIdentifier`](/documentation/AppIntents/AppEntityUIElement/identifier)

The identifier of the app entity that represents the UI element.

[`var state: AppEntityUIElement.State`](/documentation/AppIntents/AppEntityUIElement/state-swift.property)

The property that indicates if the UI element is selected.

[`var subelements: [AppEntityUIElement]`](/documentation/AppIntents/AppEntityUIElement/subelements)

An array of UI elements that represent subelements in the view hierarchy.

## Relationships

### Conforms To

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