0
votes

I have an application that is saving the couple of UIDocumnet files in local document directory and display the UIdocument data.

I want to sync this document directory folder (Each and every file saved locally) with icloud on Button Press Event. I am not able to find any support for synchronizing locally saved document with icloud. I am scratching my head since last few days.

Any help would be much appreciated thanks!

1

1 Answers

4
votes

Apple provides extensive documentation on this topic, and it's all built in to Xcode. A good starting point is Managing the Life Cycle of a Document. The basic steps are:

  1. Create the document locally
  2. Use NSFileManager to move the document to iCloud
  3. Use NSMetadataQuery to find existing iCloud documents.
  4. Use NSFileManager again to download documents from iCloud.

There are also numerous WWDC sessions on the topic over the past 2-3 years, available to anyone with a current Apple developer account.