NEW: My new book Pro SwiftUI is out now – level up your SwiftUI skills 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?




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.


Thanks so much for this.

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


a) Use CloudKit with public database

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.


Hacking with Swift is sponsored by Judo

SPONSORED Let’s face it, SwiftUI previews are limited, slow, and painful. Judo takes a different approach to building visually—think Interface Builder for SwiftUI. Build your interface in a completely visual canvas, then drag and drop into your Xcode project and wire up button clicks to custom code. Download the Mac App and start your free trial today!

Try now

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.