How To Use SwiftData with Preview | SwiftData Tutorial | #10

Поділитися
Вставка
  • Опубліковано 9 лют 2025

КОМЕНТАРІ • 26

  • @aMazinglyKeNn
    @aMazinglyKeNn 9 місяців тому +1

    This is exactly what I needed to preview some tutorial code and understand what I was doing without needing to run the simulator again every time. Thank you for such valuable information!👍

    • @tundsdev
      @tundsdev  9 місяців тому

      Glad it helped!

  • @Mahadev-x7u
    @Mahadev-x7u Рік тому +1

    Excellent series Tuns...💯 Thank you so very much 🔥 Preview is special

  • @dmacharo
    @dmacharo Рік тому +1

    This is fantastic man!

    • @tundsdev
      @tundsdev  Рік тому

      Glad you found it useful 👌🏾

  • @asdrubalchirinos
    @asdrubalchirinos Рік тому

    This is the best and must useful SwiftData video yet! 👍great work! Tunde you are outstanding!

  • @akbar_logs
    @akbar_logs 9 місяців тому

    A super efficient way of moulding things.

  • @EricTMCode
    @EricTMCode Рік тому +1

    Bro, thank you for all your great work and what you gives us 🙏

  • @MarcusTwichel
    @MarcusTwichel 7 місяців тому

    Super helpful information. Thank you for making this!

  • @tech_ch1211
    @tech_ch1211 Рік тому

    That's truly helpful, Tunds, many Thanks👍

  • @RobertHolzapfel
    @RobertHolzapfel Рік тому +1

    I can only agree with the other enthusiastic comments. This video is absolutely super helpful. Thank you so much for sharing your pioneer knowledge with us. ... I can't resist one comment: We all thought, this was a bug in the beta version ... funny ... turns out we still have the same stumbling blocks in Xcode 15.2.

    • @tundsdev
      @tundsdev  Рік тому

      Glad it was helpful!

    • @tiglionabbit
      @tiglionabbit 7 місяців тому

      This doesn't fix it. It's still broken. It actually takes a lot more boilerplate to make this sort of thing work for models with relationships. The BackyardBirds example app gets it working, but it doesn't let you choose specific records -- it just grabs the first one in the database.

  • @kslazinski
    @kslazinski Рік тому

    Great video, Tunde! Insightful and entertaining as always 😊

  • @gregh528
    @gregh528 Рік тому

    Great video thanks.

  • @ValentinKovalski
    @ValentinKovalski 6 місяців тому

    thank you so much, it was a pain

  • @veedjohnson
    @veedjohnson Рік тому +1

    Hi Tunde. I see your tutorials are amazing
    I’m a React Native engineer looking to get started with Swift.
    Pls which of your courses would you recommend I start with? Also do you have a video on roadmap? Thanks 🙏🏾

    • @tundsdev
      @tundsdev  Рік тому +1

      That’s great to hear & I’d don’t have a swift specific course yet. But i do have a SwiftUi course for beginners you can check out here
      Learn SwiftUI From Scratch In This Free SwiftUI Bootcamp (Beginner Level | SwiftUI Tutorial)
      ua-cam.com/play/PLvUWi5tdh92w0BP5gwJxgSJ12wKmYK9Y8.html

    • @veedjohnson
      @veedjohnson Рік тому

      @@tundsdev thanks a lot 🙏🏾

  • @holycrosscv
    @holycrosscv Рік тому

    Another excellent tutorial! Thanks.
    On my test project, the app launches and loads the default JSON items as expected. But I get a crash in the preview. Any guess what might be happening?
    Thanks!

    • @tundsdev
      @tundsdev  Рік тому

      This crash is most likely linked to the fact that you haven't registered the container first like I cover in this video. You may want to check out the final sample code and compare what's missing from here.
      github.com/tunds/youtube-content-2023/tree/main/How%20To%20Use%20SwiftData%20with%20Preview%20%7C%20SwiftData%20Tutorial/Source%20Code

    • @holycrosscv
      @holycrosscv Рік тому

      Thanks for the quick reply!! I checked the code carefully and mine is identical to what you have here. Nt sure as it runs correctly. Very strange. Thanks again for the. reply!@@tundsdev

    • @tundsdev
      @tundsdev  Рік тому

      If you run my project does it work? Also i’m using Xcode 15 B8 in this vid so it may be because you’re using a different version of Xcode possibly?

    • @holycrosscv
      @holycrosscv Рік тому

      Thanks again. I am using 8.5 as well. It is not a big deal, it is just the default JSON that is crashing the preview. The version without the default data works as expected. I will keep tinkering when I remove what I expect is the one variable that is crashing the preview, the code runs but does not display the default data as I expect the decode fails. Thanks!!@@tundsdev

    • @tiglionabbit
      @tiglionabbit 7 місяців тому

      @@holycrosscv It's crashing for me too. The solution in this video doesn't work for models that have relationships. It just crashes with no explanation. Might need to do something more involved like what's in the BackyardBirds example app, where it creates the records, discards them, and then queries for them using an @Query in a wrapper view.