Contents

CoreSpotlightSource

A search source that retrieves data from the app’s Spotlight index.

Declaration

struct CoreSpotlightSource

Mentioned in

Overview

Use this type to configure the Spotlight search tool to search your app’s indexed content. When performing searches, the tool queries your content for CSSearchableItem objects that match the specified criteria. When delivering search results to the model, the tool delivers each item’s identifier and any attributes you specify in the fetchAttributes property. To provide additional item-specific content that isn’t in the Spotlight index, provide a delegate object to generate that data dynamically from your content.

This type is @unchecked Sendable because CSSearchableIndexDelegate is a non-Sendable ObjC protocol. If you provide a delegate object, you must ensure that object is safe to use across isolation boundaries.

Topics

Creating a Spotlight source

Configuring the search options

Providing additional attributes

See Also

Data sources