Indexing with CSSearchableItem

Currently, Spotlight indexing works and users can find any content they have seen before. It's even possible to select results from the Spotlight index and have the app open on the correct page. If you've taken on the challenge of implementing the handling of detail pages, your app should be able to handle the continuation of any activity that was indexed. Wouldn't it be cool if we could be a bit more proactive about indexing though? Ideally, the app would index any new Family Members or movies as soon as the user adds them.

This is what CSSearchableItem is good at. The CSSearchableItem class enables you to index content that the user might not have seen before. Indexing CSSearchableItem instances is pretty straightforward. The steps involved are similar to how you could index user activities. To index a searchable item, you should create an instance of CSSearchableItem and provide it with attributes that describe the indexed item. These attributes are encapsulated in an instance of CSSearchableItemAttributeSet.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset