Simple CoreData Sample

Hi All,

I already have an App using SwiftUI… and would like to be able to save some data, a couple of text fields to core data.

I ticked the box Coredata when creating the app, however all the sample code on the net that I have found looks to be so complicated.

Looks harder then when I used Core Data in UIKit…

Any very simple samples out there ?




I have been following Chris’ SwiftUI tutorials so now just getting up to speed, so not much help here.

Have you used a Realm database yet? It is SOOOOO much more simple to use when compared to Core Data. I had a couple apps using Core Data and when Chris introduced me to Realm with this database course, it changed my life! :slight_smile:

Realm is a 10th of the code to get the same work done and much more approachable way to handling data in an app for me.

If I have any brainstorm about SwiftUI, I will certainly chime back in.


G,Day Mark,

Thanks for the reply and help… I’ll take a look at Realm… Do you know if it works with SwiftUI?

Also… can I add it to an already exisiting App ?



Merry Christmas !

HI Craig,

I am just tipping my toe into SwiftUI so I have not try to building a Realm project wi hat framework as yet, I will report back when I get into one.

In terms of replacing Core Data with a Realm database, what I did is remove all the call to Core Data and replace them with call to a Realm database. I will encourage you to take Chris’ database course, he walks through compare and contrast of three options: Core data, Realm, Firebase. I launched for there!

Holiday blessings to you and your’s.


Hi Mark,

Thanks for the feec back on that… I will take a look for sure.

Great chatting with you as always.

Have a wonderful holiday break.