Sharing Core Data With CloudKit in SwiftUI

Learn to share data between CoreData and CloudKit in a SwiftUI app. By Marc Aupont.

4.7 (9) · 5 Reviews

Download materials
Save for later
Share
You are currently viewing page 4 of 4 of this article. Click here to view the first page.

Where to Go From Here?

You can download the completed project files by clicking the Download Materials button at the top or bottom of the tutorial.

In this tutorial, you learned the important steps to share Core Data with CloudKit, including:

  • Using NSPersistentCloudKitContainer to share the data.
  • Presenting a cloud-sharing view.
  • Accepting share invitations and fetching the shared data.
  • Differentiating private data and shared data in SwiftUI.

You learned the new methods introduced in iOS 15 and solved challenges and minor bugs in the app.

For more information, check Apple’s video on Build apps that share data through CloudKit and Core Data.

Here’s Apple’s sample project on Synchronizing a Local Store to the Cloud.

If you have any questions or comments, please join the forum discussion below.