Donny Wals: Using Core Data in a Modern SwiftUI Application

Поделиться
HTML-код
  • Опубликовано: 16 ноя 2024

Комментарии • 18

  • @yevhen_san
    @yevhen_san Год назад +2

    Finally I mange to fix my previews with Core Data. Thank you for sharing!

  • @aleksandrfilatov6261
    @aleksandrfilatov6261 12 дней назад

    thanks for video! BTW I use CoreData Studio for my data monitoring

  • @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!

  • @soilb0y
    @soilb0y 2 года назад

    Thanks. Perhaps I won’t be abstracting core data away just yet. I’m going to go with the flow! Thanks

  • @amdizle28
    @amdizle28 Год назад

    Donny killed it, great presentation great info and seasoned tech understanding

  • @tamasterjek7520
    @tamasterjek7520 3 года назад

    Thank you for the multi context solution. I was looking for this for a while...

  • @treboc2942
    @treboc2942 2 года назад

    Thank you for your time to upload such great content and provide it for us for free. Awesome!

  • @notorioustofu3482
    @notorioustofu3482 2 года назад +4

    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 11 месяцев назад

      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... :)

  • @w0mblemania
    @w0mblemania Год назад

    This was very useful.
    Thank you!

  • @ushadesai6306
    @ushadesai6306 2 года назад +1

    Is the topic 'passing NSManagedObject to childViewContext' part of Practical Core Data book ?

  • @0xjorgev
    @0xjorgev 3 года назад +1

    Great talk Donny!

  • @mhfs61
    @mhfs61 3 года назад +4

    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.

  • @happy__amoeba
    @happy__amoeba 3 года назад

    Excellent video

  • @jasperdunn
    @jasperdunn 3 года назад

    Thanks Donny!

  •  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 2 года назад +1

      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.