In this tutorial, I am discussing ways on how to use Core Data with SwiftUI 2.0. I will use the template generated by Xcode for Core Data. In order to get a correct updating of the UI it is very important to consider Core Data entities as classes. In SwiftUI we can use the @FetchRequest property wrapper.
I will try to use MVVM design pattern in a different way. The goal is to write clean code and include unit test.
00:00 intro
02:16 What is MVVM?
05:05 Xcode template with Core data
20:27 using extensions for convenience initialisers
26:27 Core data entities can act like view models
34:02 optional attributes and syntactic sugar
39:11 core data working with the preview
47:14 unit tests
54:30 save content with ScenePhase going into background
01:00:06 wrap up
Watch more
MVVM SwiftUI tutorial: • How to use MVVM in iOS...
Stanford course SwiftUI and Core Data Part 1: • Lecture 11: Picker
Stanford course SwiftUI and Core Data Part 2: • Lecture 12: Core Data
If you liked what you learned and you want to see more, check out one of my courses!
👨💻 my SwiftUI course school.swiftyplace.com/course...
👨💻 my Core Data and SwiftUI course school.swiftyplace.com/course...
👩🏻💻 Combine course
school.swiftyplace.com/course...
#SwiftUI #CoreData
Негізгі бет How to best use Core Data with SwiftUI 2.0 - MVVM - Unit test and working with the preview
Пікірлер: 33