NEW: Start my new Ultimate Portfolio App course with a free Hacking with Swift+ trial! >>

SOLVED: Cloud Kit and Storing Data

Forums > iOS

@clc80  

I want to build an app that uses Cloud Kit to sync data between a users devices. Do I also have to use CoreData to store the data? Or is having it on the cloud enough?

   

You can use just CloudKit but in case user is offline they wont see anything. So you would likely need some sort of caching mechanism.

With Core Data you could try

https://developer.apple.com/wwdc19/202

Looks like you could just slightly modify how Core Data is set up to get iCloud sync "for free" but I havent tried it yet and dunno how seamless this is.

1      

You can look at Integrating CloudKit with Core Date in SwiftUI to share data across devices.

If you want to do in SwiftUI

1      

The Apple WWDC talk about CloudKit and CoreData is super advanced. I could not understand much of it.

If you are starting out the second link by @NigelGee pointing to the SchwiftyUI video is quite good, and it doesnt matter if it is SwiftUI because CloudKit is still a separate framework, so it will be kinda of same to connect to the APIs.

1      

@clc80  

Thank you!

   

Hacking with Swift is sponsored by RevenueCat

SPONSORED Building and maintaining in-app subscription infrastructure is hard. Luckily there's a better way. With RevenueCat, you can implement subscriptions for your app in hours, not months, so you can get back to building your app.

Try it for free

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.