Instance Method

isUbiquitousItem(at:)

Returns a Boolean indicating whether the item is targeted for storage in iCloud.

Declaration

func isUbiquitousItem(at url: URL) -> Bool

Parameters

url

Specify the URL for the file or directory whose status you want to check.

Return Value

true if the item is targeted for iCloud storage or false if it is not. This method also returns false if no item exists at url.

Discussion

This method reflects only whether the item should be stored in iCloud because a call was made to the setUbiquitous(_:itemAt:destinationURL:) method with a value of true for its flag parameter. This method does not reflect whether the file has actually been uploaded to any iCloud servers. To determine a file’s upload status, check the NSURLUbiquitousItemIsUploadedKey attribute of the corresponding NSURL object.

See Also

Managing iCloud-Based Items

var ubiquityIdentityToken: (NSCoding & NSCopying & NSObjectProtocol)?

An opaque token that represents the current user’s iCloud Drive Documents identity.

func url(forUbiquityContainerIdentifier: String?) -> URL?

Returns the URL for the iCloud container associated with the specified identifier and establishes access to that container.

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

Indicates whether the item at the specified URL should be stored in iCloud.

func startDownloadingUbiquitousItem(at: URL)

Starts downloading (if necessary) the specified item to the local system.

func evictUbiquitousItem(at: URL)

Removes the local copy of the specified item that’s stored in iCloud.

func url(forPublishingUbiquitousItemAt: URL, expiration: AutoreleasingUnsafeMutablePointer<NSDate?>?) -> URL

Returns a URL that can be emailed to users to allow them to download a copy of a flat file item from iCloud.

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