Instance Method

deleteSearchableItems(withDomainIdentifiers:completionHandler:)

Removes from the index all searchable items associated with the specified domain.

Declaration

func deleteSearchableItems(withDomainIdentifiers domainIdentifiers: [String], completionHandler: ((Error?) -> Void)? = nil)

Parameters

domainIdentifiers

The domain identifier that describes the group of items to delete. To learn more about domain identifiers, see domainIdentifier.

completionHandler

The block that’s called when the request has been journaled by the index (“journaled” means that the index makes a note that it has to perform this operation). Note that the request may not have completed.

The block receives the following parameter:

error

If an error occurred, this parameter holds an error object that explains the error. Otherwise, the value of this parameter is nil.

Discussion

Use this method to delete groups of items. Note that the delete operation is recursive. For example, if domain identifiers are of the form <account-id>.<mailbox-id>, calling this method and specifying <account-id> deletes items with the specified account and any mailbox.

See Also

Managing Items in an Index