Instance Method


Returns a different object for a given query result object.


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



The query that produced the result object to replace.


The query result object to replace.

Return Value

Object that replaces the query result object.


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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software