Contents

deleteSpotlightIndex(completionHandler:)

Deletes all searchable items from the configured index.

Declaration

func deleteSpotlightIndex(completionHandler: @escaping  @Sendable ((any Error)?) -> Void)
func deleteSpotlightIndex() async throws

Discussion

The closure returns no value and takes only a single parameter, which is an error object that contains information about issues preventing the deletion of searchable items, or nil if Core Spotlight successfully deletes all searchable items.

Depending on the cause of the issue, an error can originate from Core Data or from Core Spotlight. Make sure your app can handle both scenarios.

See Also

Managing the Index