11

Is there a way to make my Documents directory synchronized with iCloud?

I have setup all permissions and entitlements, but have no idea what to do next.

Could you please provide a swift code snippet or point into a direction I should look to?

Alex Smolov
  • 1,831
  • 4
  • 24
  • 43

4 Answers4

2

You can use iCloud's CloudKit services for this.

Have a look at the Quick Start Guide for iCloud's Cloudkit here.

Razvan
  • 4,122
  • 2
  • 26
  • 44
  • Thanks, but I need iCloud. – Alex Smolov May 01 '15 at 11:48
  • If you had read the link I've provided, you would already know that CloudKit is a service that's part of iCloud. CloudKit is one of three app services provided by iCloud. The other iCloud app services—key-value storage and iCloud documents—also appear in the iCloud settings in Xcode. – Razvan May 01 '15 at 12:18
2

When I needed to keep NSUserDefaults in sync via iCloud in simple apps, I used: MKiCloudSync by Mugunth Kumar. While still Objective-C, it's pretty straightforward to use.

If you need iCloud Documents sync, you might check out iRareMedia/iCloudDocumentSync. Of course, this is a bit more work, but still easier than implementing all the methods by yourself.

Have a nice day,

@cdf1982

cdf1982
  • 764
  • 1
  • 18
  • 34
2

You can use iCloudDrive of iOS 8 to store documents in iCloud Drive..

Refer below links for iCloud set up for your app.

https://unionassets.com/iosnative/icloud-setup-25

http://www.raywenderlich.com/83116/beginning-cloudkit-tutorial

Refer below for saving document to iCloudDrive.

Save iOS 8 Documents to iCloud Drive

Refer below to view the documents which you have saved in iCloudDrive

https://github.com/iRareMedia/iCloudDocumentSync

Hope all the above links are useful to get the task done..!

Community
  • 1
  • 1
Vidhyanand
  • 5,369
  • 4
  • 26
  • 59
2

The following 3 steps should get you going:

Step 1: Preparing the app to use iCloud Storage

Step 2: Learing to manage your files using the UIDocument Class

Step 3: Using iCloud Storage in your app

Cheers, Istvan

Istvan
  • 1,219
  • 1
  • 8
  • 9