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 try! Swift Tokyo.

SPONSORED Ready to dive into the world of Swift? try! Swift Tokyo is the premier iOS developer conference will be happened in April 9th-11th, where you can learn from industry experts, connect with fellow developers, and explore the latest in Swift and iOS development. Don’t miss out on this opportunity to level up your skills and be part of the Swift community!

Get your ticket here

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.