Instance Method

metadataQuery(_:replacementObjectForResultObject:)

Returns a different object for a given query result object.

Declaration

optional func metadataQuery(_ query: NSMetadataQuery, replacementObjectForResultObject result: NSMetadataItem) -> Any

Parameters

query

The query that produced the result object to replace.

result

The query result object to replace.

Return Value

Object that replaces the query result object.

Discussion

By default query result objects are instances of the NSMetadataItem class. By implementing this method, you can return an object of a different class type for the specified result object.

See Also

Getting Query Results