I'm trying to safely perform the apparently complex task for a cloud storage API, namely "downloading files", but it seems like iCloud APIs are comically broken beyond repair:
-[NSFileCoordinator coordinateAccessWithIntents:queue:byAccessor:]
calls the accessor block before all files have finished downloading.- The same API will also return success (called the block with
error == nil
) even if the download fails (e.g. the phone is in airplane mode). I both cases, the files requested by the intents will not exist. -[NSFileManager startDownloadingUbiquitousItemAtURL:error:]
does not have a completion block (Why?!?!)- Similarly, this API will return success even if it fails (e.g. airplane mode)
- Manually checking
NSURLUbiquitousItemIsDownloadingKey
is broken as well, failed downloads (e.g. Airplane mode again) will retain their "Downloading" status, andNSURLUbiquitousItemDownloadingErrorKey
is never updated.
How can one safely download a file from iCloud if all of the APIs are broken?