Instance Method

item(at:didMoveTo:)

Notifies relevant file presenters that the location of a file or directory changed.

Declaration

func item(at oldURL: URL, didMoveTo newURL: URL)

Parameters

oldURL

The old location of the file or directory.

newURL

The new location of the file or directory.

Discussion

If you move or rename a file or directory as part of a write operation, call this method to notify relevant file presenters that the change occurred. This method calls the presentedItemDidMove(to:) method for any of the item’s file presenters. If the item is a directory, this method calls presentedItemDidMove(to:) on the file presenters for the item’s contents. Finally, it calls presentedSubitem(at:didMoveTo:) on the file presenter of any directory containing the item.

You must call this method from a coordinated write block. Calling this method with the same URL in the oldURL and newURL parameters is harmless. This call must balance a call to item(at:willMoveTo:).

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