Тёмный

Donny Wals: Using Core Data in a Modern SwiftUI Application 

Swift Heroes
Подписаться 7 тыс.
Просмотров 13 тыс.
50% 1

Presented at Swift Heroes 2021
USING CORE DATA IN A MODERN SWIFTUI APPLICATION
Donny Wals, iOS Engineer, Disney Streaming Services
Learn how you can make good use of Core Data in a SwiftUI application. This talk will go over the basics of setting up a Core Data stack in a SwiftUI app, fetching data with and without @FetchRequest, and you'll learn how you can bind a managed object to a form using a child managed object context.
Attendees will learn all the important basics of using Core Data in a modern application.
#SwiftHeroes #SwiftConnected
swiftheroes.com/
/ swiftheroes_it
/ swift-heroes

Опубликовано:

 

15 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 17   
@yevhen_san
@yevhen_san Год назад
Finally I mange to fix my previews with Core Data. Thank you for sharing!
@ricifaviero
@ricifaviero 2 года назад
I’m a complete beginner, but watch the whole video and subscribed to channel, so I can come back whenever I lean more!
@amdizle28
@amdizle28 Год назад
Donny killed it, great presentation great info and seasoned tech understanding
@treboc2942
@treboc2942 2 года назад
Thank you for your time to upload such great content and provide it for us for free. Awesome!
@soilb0y
@soilb0y 2 года назад
Thanks. Perhaps I won’t be abstracting core data away just yet. I’m going to go with the flow! Thanks
@tamasterjek7520
@tamasterjek7520 2 года назад
Thank you for the multi context solution. I was looking for this for a while...
@w0mblemania
@w0mblemania Год назад
This was very useful. Thank you!
@mhfs61
@mhfs61 2 года назад
Thank you Donny. Very clear and thoughtful presentation. I like your emphasis on not fighting the framework. The child context concept is quite helpful. I implemented a solution to use one view for both creating and updating, but that alway felt like dirty hack with too many lines of code. My refactoring starts straight away.
@0xjorgev
@0xjorgev 3 года назад
Great talk Donny!
@notorioustofu3482
@notorioustofu3482 2 года назад
Tried implementing this a few different ways in a ListView -> DetailView case and always hit the same wall. While the child context does work as a scratch pad in the view model, and saves changes on calling persist, I can't seem to get those changes to trigger a refresh on the initial ListView. Unit tests confirm it's working and relaunch the app shows the change. Any ideas?
@dannybehar7148
@dannybehar7148 9 месяцев назад
I'm running into the same issue. One thing that seems to work is to turn the ViewModel into an ObservableObject and then adding objectWillChange.send() on any code within the viewModel that changes the coreData model. This doesn't take advantage of the NSManagedObjects being observable though so hopefully there is a more straightforward path that we are missing... :)
@happy__amoeba
@happy__amoeba 3 года назад
Excellent video
@jasperdunn
@jasperdunn 3 года назад
Thanks Donny!
@ushadesai6306
@ushadesai6306 2 года назад
Is the topic 'passing NSManagedObject to childViewContext' part of Practical Core Data book ?
3 года назад
Is Core Data is ❤️ and CloudKit 💪
@indiekiduk
@indiekiduk 2 года назад
Too many SwiftUI mistakes in the code examples. 25:57 Although EditViewModel is a struct, inside its init it inits a context object which we must not do in body. Instead, the child context should be created in an action. 28:42 should be @Binding not @State. Although to be honest view models in SwiftUI is unnecessary, the View structs are actually the model for the UIViews on screen and the property wrappers give them object semantics. Usually we call @State structs that group vars simple Configs, e.g. EditConfig
@yhmlco
@yhmlco Год назад
Disagree here. For the childViewContext to work it we need to keep a reference to it somewhere, and in this case a ViewModel is a better choice as it can be thunked into a StateObject and only instantiated when needed.
Далее
Concurrency of SwiftData, by Donny Wals (English)
31:08
New Race ? 🪽| Doge Gaming
00:12
Просмотров 1,5 млн
Using Closures as Dependencies
15:18
Просмотров 1,2 тыс.
The Story of Next.js
12:13
Просмотров 576 тыс.
SwiftData Basics in 15 minutes
15:18
Просмотров 45 тыс.
New Race ? 🪽| Doge Gaming
00:12
Просмотров 1,5 млн