---
title: "appEntityIdentifier(forSelectionType:identifier:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/appentityidentifier(forselectiontype:identifier:)"
---

# appEntityIdentifier(forSelectionType:identifier:)

Associates the items in a SwiftUI list view with app entities to make them discoverable by Apple Intelligence and Siri.

## Declaration

```swift
nonisolated func appEntityIdentifier<I>(forSelectionType itemType: I.Type = I.self, identifier: @escaping @Sendable (I) -> EntityIdentifier?) -> some View where I : Hashable

```

## Discussion

Discussion Use this modifier to make app entities that describe data in a list discoverable by Apple Intelligence and Siri. This provides additional context to the system when the list appears onscreen and people scroll through it. The following example associates a List view that displays books with an app entity for each book in the list. struct BookListView: View {    let books: [Book]    @State private var selection = Set<Book.ID>()    var body: some View {        List(selection: $selection) {            ForEach(books) { book in                BookView(book.name)            }        }        .appEntityIdentifier(forSelectionType: Book.ID.self) { bookId in            EntityIdentifier(for: Book.self, identifier: bookId)        }    }  } For more information, refer to doc:Making-onscreen-content-available-to-siri-and-apple-intelligence and App Intents.

## See Also

### App intents

- [appEntityIdentifier(_:)](swiftui/view/appentityidentifier(_:).md)
- [appEntityUIElements(_:)](swiftui/view/appentityuielements(_:).md)
- [onAppIntentExecution(_:perform:)](swiftui/view/onappintentexecution(_:perform:).md)
- [shortcutsLinkStyle(_:)](swiftui/view/shortcutslinkstyle(_:).md)
- [siriTipViewStyle(_:)](swiftui/view/siritipviewstyle(_:).md)
