Adding CSSearchableItem instances to the search index

In the MustC application, the goal is to add family members and movies to the search index as soon as the user adds them. A factory method that creates the CSSearchableItemAttributeSet instance that describes the item that should be indexed is already provided. However, you can't directly add these to the index. To add information to the search index manually, you need instances of CSSearchableItem. Every searchable item requires a unique identifier and a domain identifier.

The unique identifier is used to identify an indexed item. It's essential that you set this value to something that is unique because otherwise, Spotlight will overwrite the entry with something else that has the same ...

Get Mastering iOS 12 Programming - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.