Instance Method

evictUbiquitousItem(at:)

Removes the local copy of the specified cloud-based item.

Declaration

func evictUbiquitousItem(at url: URL) throws

Parameters

url

Specify the URL to a file or directory in iCloud storage.

Discussion

Do not use a coordinated write to perform this operation. In macOS 10.7 or earlier, the framework takes a coordinated write in its implementation of this method, so taking one in your app causes a deadlock. In macOS 10.8 and later, the framework detects coordination done by your app on the same thread as the call to this method, to avoid deadlocking.

This method does not remove the item from the cloud. It removes only the local version. You can use this method to force iCloud to download a new version of the file or directory from the server.

To delete a file permanently from the user’s iCloud storage, use the regular FileManager routines for deleting files and directories. Remember that deleting items from iCloud cannot be undone. Once deleted, the item is gone forever.

See Also

Related Symbols

func setUbiquitous(Bool, itemAt: URL, destinationURL: URL)

Sets whether the item at the specified URL should be stored in the cloud.

func removeItem(at: URL)

Removes the file or directory at the specified URL.