GO FURTHER, FASTER: Try the Swift Career Accelerator today! >>

SOLVED: Can i use core data to store information for my app

Forums > SwiftUI

Hi All,

Lets say i have a list of cars for my app and i always want them to be available in the app - for every user.

Can i store these in core data or is this just for stuff individual to the user?

Thanks

Adam

3      

You can ship your app with the list of cars in CoreData. Then it's available for everyone using your app. If you want the user to enter cars in your app on his device and want that these are available for every other user of your app you need an external database service.

3      

Thanks so much for this.

How would i go about adding cars to core data that every user can use?

3      

a) Use CloudKit with public database https://developer.apple.com/icloud/cloudkit/

b) Have some sort of custom backend with database and save the cars there

In both cases there will be a lot of syncing required. I think the CloudKit route will be much easier.

You would then still save the cars objects into Core Data but also kept track of sync status and upload new ones to the public database.

3      

Hacking with Swift is sponsored by Essential Developer.

SPONSORED Transform your career with the iOS Lead Essentials. This Black Friday, unlock over 40 hours of expert training, mentorship, and community support to secure your place among the best devs. Click for early access to this limited offer and a free crash course.

Save your spot

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

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

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.