associateAppEntity(_:priority:)
Associates the specified app entity with this attribute set.
Declaration
func associateAppEntity<Entity>(_ appEntity: Entity, priority: Int = 0) where Entity : IndexedEntityParameters
- appEntity:
The entity to associate with the attributes. Choose the entity with the same data as the Cssearchableitem that you’re creating.
- priority:
The importance of this item compared to other donated items. Give more important items a higher priority value. The App Intents system uses priorities to determine what items to show in suggestions and other places.
Discussion
If your app has an AppEntity object that equates to the CSSearchableItem you’re creating, use this method to connect the two objects. When your searchable item appears in search results, Spotlight can use the provided entity to perform related actions. For example, it can ask your app to open the entity and display its content.
For additional information about the relationship between searchable items and entities, see Making app entities available in Spotlight.