Getting Started With Core Data SwiftUI XCode12

Hi All,

I am very new to making apps of this nature (PHP background) and I would love if someone could point me in the direction of / show me some code, of how to set up core data and CRUD.

I know there are examples out there but when starting a new cross platform app in Xcode, using 100% swiftUI there isn't much that shows what code should go where and what each bit is doing.

We no longer have an app or scene delegate file where a lot of this code was stored previously so I would find it very helpful if this could be spelled out.

Also when I move to using iCloud, so that my app can be in the same state on several devices, will there be an issue pulling data from the CloudKit public database and using core data at the same time?

Any clarification needed I will happily supply.

Thanks in advance,

Adam
Honestly if you are new to Swift, I wouldn't recommend starting with Core Data. It has a big learning curve. However, if you insist, here is guide I made a couple of weeks ago when I was learning: https://blog.arturofm.com/swiftui-cheat-sheet/#coredata There is more to it, but I haven't had the time to add it. But there you have the basic CRUD
Thanks for this, I will take a look.

What I am finding tricky is that everything keeps changing. Now, for example, there is no app delegate file made when you start a new xplatform app. So I am assuming that I now use the xxxxxxApp.swift file instead.

On Xcode 11 the app delegate was prepopulated with a lot of code and comments, whereas this new file has almost nothing in it.

Thanks all the same, it is appreciated.

Adam
This thread provides an example of a SwiftUI + Core Data setup: https://developer.apple.com/forums/thread/650876

To clarify some terms: Core Data is a framework for local persistence and CloudKit can be seen as a transport technology that deals with storing data in iCloud. If you want to store objects from Core Data in iCloud, you can implement the syncing behavior on your own or make use of NSPersistentCloudKitContainer, a class that automatically mirrors changes in a local Core Data container to iCloud and keeps each device up-to-date.
Getting Started With Core Data SwiftUI XCode12
 
 
Q