In my UIKit apps, collection view cells that have a context menu gain an Ask Siri item in iOS 27 without me doing anything. In my SwiftUI app I have a LazyVGrid containing a ForEach of CellView which is a Button that has a contextMenu, yet there’s no Ask Siri button in the context menu. What determines whether or not it will be added? What do I need to do to allow the system to add it?
Hello @Jordan,
From WWDC26 session: Modernize your UIKit app
Menus will automatically display this item when there's content relevant for Siri.
To provide more relevant information specific to your app, use the new View Annotations API. With it you can annotate specific views with AppEntities."
For SwiftUI:
Use .appEntityIdentifier() on something like each cell inside of a ForEach:
ForEach(items) { item in
CellView(item: item)
.appEntityIdentifier(
EntityIdentifier(for: MyItemEntity.self, identifier: item.id)
)
.contextMenu { ... }
}
This is the View Entity Annotation API from session 343: Explore advanced App Intents features for Siri and Apple Intelligence
Note: MyItemEntity must conform to AppEntity with a persistent identifier.
For more information see: App Intents
I hope this helps!
Travis