阅读背景:

将所有文档目录同步到iCloud

来源:互联网 

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

有没有办法让我的文档目录与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?

您能否提供一个快速的代码片段或指向我应该指向的方向?

4 个解决方案

#1


2  

You can use iCloud's CloudKit services for this.

您可以使用iCloud的CloudKit服务。

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

在这里查看iCloud Cloudkit快速入门指南。

#2


2  

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

您可以使用iOS 8的iCloudDrive在iCloud Drive中存储文档。

Refer below links for iCloud set up for your app.

请参阅以下链接,为您的应用设置iCloud。

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

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

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

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

Refer below for saving document to iCloudDrive.

有关将文档保存到iCloudDrive的信息,请参阅下文。

Save iOS 8 Documents to iCloud Drive

将iOS 8文档保存到iCloud Drive

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

请参阅下文以查看您在iCloudDrive中保存的文档

https://github.com/iRareMedia/iCloudDocumentSync

https://github.com/iRareMedia/iCloudDocumentSync

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

希望以上所有链接对完成任务很有用..!

#3


1  

The following 3 steps should get you going:

以下3个步骤可以帮助您:

Step 1: Preparing the app to use iCloud Storage

第1步:准备应用程序以使用iCloud Storage

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

第2步:学习使用UIDocument类管理文件

Step 3: Using iCloud Storage in your app

第3步:在您的应用中使用iCloud Storage

Cheers, Istvan

干杯,伊斯特万

#4


0  

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.

当我需要在简单的应用程序中通过iCloud保持NSUserDefaults同步时,我使用了:Mugunth Kumar的MKiCloudSync。虽然仍然是Objective-C,但使用它非常简单。

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.

如果您需要iCloud Documents同步,您可以查看iRareMedia / iCloudDocumentSync。当然,这是一项更多的工作,但仍然比自己实现所有方法更容易。

Have a nice day,

祝你今天愉快,

@cdf1982

@ cdf1982


分享到: