ICloud - File Transfer Complete

I can move the file from the local directory to iCloud using the setUbiquitous:YES condition. File transferred successfully. If the file size is large, it takes some time to complete the move. Is there a way to identify if the file has completed the transition to iCloud? Thank you in advance for your answers.

+4
source share
2 answers

Note. I did not do this myself, so all the information below is just reading the documentation:

The NSMetadataItem class has, among other things, an NSMetadataUbiquitousItemIsUploadedKey attribute NSMetadataUbiquitousItemIsUploadedKey . Knowing this, you should be able to configure NSMetadataQuery , which notifies you as soon as the item has been loaded.

+3
source

You can check with NSUURL getResourceValue: forKey: error: method

NSURLUbiquitousItemIsUploadedKey - Indicates that locally made changes were successfully uploaded to the iCloud server.

NSURLUbiquitousItemIsUploadingKey - Indicates that locally made changes are now uploaded to the iCloud server.

NSURLUbiquitousItemPercentUploadedKey - for the loaded item indicates what percentage of changes have already been uploaded to the server.

More details: https://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/iCloud/iCloud.html#//apple_ref/doc/uid/TP40007072-CH5-SW1

+3
source

Source: https://habr.com/ru/post/1380137/


All Articles