SwiftData For Beginners: How To Build A To-Do List App In SwiftUI | #1

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

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

  • @tundsdev
    @tundsdev  Год назад +8

    🚨Xcode Update🚨
    At 21:08 starting from Xcode 15 Beta 5, when sorting items you now need to include the root in the keypath too, so update the sort parameter to look like this.
    @Query(sort: \ToDoItem.timestamp) private var items: [ToDoItem]
    If you're having issues wtih the SwiftUI Previews I'd recommend watching my video in this course that shows you how to handle working with SwiftUI Previews & SwiftData down below!
    ruclips.net/video/jCC3yuc5MUI/видео.html

    • @tundsdev
      @tundsdev  Год назад +6

      Also when working with filters you need to specify the type too below is an example
      @Query(
      filter: #Predicate { $0.isCompleted == false }
      ) private var items: [ToDoItem]
      A combination of the two would look like this
      @Query(
      filter: #Predicate {$0.isCompleted == false},
      sort: \ToDoItem.timestamp
      ) private var items: [ToDoItem]

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

      Thank you !! 😅spent a while stuck on this and couldve just opened the comments @@tundsdev 🤦‍♂

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

      In the release Version 15.0.1 (15A507) the root is no longer required.

  • @nileshjdarji
    @nileshjdarji 4 месяца назад +3

    It's great that you are pasting code to save time but it would be nice if you quickly go over the code that you pasted so we don't have to pause the video and read the code. Because sometimes there is more code to fit in the screen and we cannot see everything at one time. Just a suggestion. I am enjoying this series.👍

  • @abdouett3676
    @abdouett3676 Год назад +1

    Thank you for the video! To format a code to multiple lines, it’s actually possible scan the desired code > Right clic > Refractor > Format to multiple lines.

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

      Glad you enjoyed the video👌🏾

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

      @@tundsdev but did you enjoy his tip? Lol.

  • @ShawnChristopher10101
    @ShawnChristopher10101 Год назад +3

    Thanks for the video. Getting into Swift now from a C#/React/Angular and this makes sense. Going to check out your other videos as I like your teaching style....and no, the fingers and trolley are cool ways to connect with people.

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

      Glad it was helpful!

  • @nylelevi750
    @nylelevi750 Год назад +1

    Can't believe the difference between CoreData and SwiftData. Thanks for the vid!

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

      Glad you enjoyed it 👌🏾

  • @evangelosspyromilios5994
    @evangelosspyromilios5994 Год назад +5

    Thanks for the video mate! Having spent hours and hours to learn CoreData is simply amazes me how easy things are now with SwiftData! A 'part 2' of the video could include how to make relationships between models ;-)

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

      Thanks and lol that is Part 2, the only thing deleting items with relationships crashes a lot at the moment, and i don't want to give y'all an half asses video so I hope they resolve this so that I can give you the best possible vid. Make sure you checking out the playlist since i'll be releasing a ton of videos about this topic on there as this app starts to grow 🤝

    • @tundsdev
      @tundsdev  Год назад +1

      Here is the vid, explaining relationships btw 👀
      ruclips.net/video/_QMalUGTM4E/видео.htmlsi=NRPtyNTXkH9M3lre

  • @profgallaugher
    @profgallaugher Год назад +3

    Great work. You do such good work. Swift on!

  • @pgong415
    @pgong415 Год назад +1

    Thanks for your efforts to show how to use SwiftData to build a ToDo app, where essential concepts and techniques are demonstrated. Great! You really help me sort out one of my problems - how to update items in SwiftData without using the trump merge policy. and I found the solution is so easy. Yes, of course because of beta version, the updating view can not be easily previewed, i believe the apple engineers can get it sorted asap before the official version is released. Bravo!

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

      Glad you enjoyed it !

  • @julianjpg
    @julianjpg 9 месяцев назад +1

    You are awesome man! Thanks for saying my day!!! Wait a minute…. Ma hol coding life!! 👏🏾👏🏾👏🏾👏🏾👏🏾👏🏾

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

    How did you "collapse" the HStack to give yourself more room? That looks handy!

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

      It’s a feature in Xcode called code folding, you have to turn it on via your preferences 👌🏾

  • @DezDoesMTB
    @DezDoesMTB 6 месяцев назад +1

    Love the Deep Dish Swift shirt!!

  • @Louis-i4l
    @Louis-i4l Год назад +2

    Thank you so much for this video! I'm completely new to data persistence and to iOS development in general, so I found it super helpful.

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

      Glad you enjoyed it 🤝

  • @solidenix
    @solidenix 11 месяцев назад

    Great Video !
    Question, what would you change if you wanted to add additional criteria for sorting ? for example to sort by completed AND by timestamp?

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

    Smooth and clear video. Cheers 🥂

  • @aerospaceexportsincorporat2753
    @aerospaceexportsincorporat2753 Год назад +1

    Great video, thank you for sharing. Any chance in the future you could teach on how to add a “Select All” feature to this app to allow for deleting multiple ToDos at once? Again, well done!

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

      Thanks & yh i’ll consider it 👌🏾

  • @alejmc
    @alejmc Год назад +1

    Just 9mins in but have subbed already, as someone that’s quite in diapers regarding SwiftUI and the surrounding Apple Frameworks this is quite concise and very well explained.
    I wonder if it is still alright to peek into CoreData (I also know nothing about it) since SwiftData will probably won’t be backported to previous iOS versions?
    I had started 100 Days of SwiftUI and one of the main things is “to not get distracted with too many things” but I guess WWDC23 and the new frameworks deserve a pause on that.
    Nevertheless, thanks for this… and for the chuckles too along the way 😅

    • @tundsdev
      @tundsdev  Год назад +1

      Thanks and if you’re interested in Core Data in SwiftUI. Then I actually have a video that covers this. That may interest you
      Build Your Own Contacts App!!! | Core Data SwiftUI Tutorial
      ruclips.net/video/rTXkGCg58w0/видео.html

    • @alejmc
      @alejmc Год назад +1

      @@tundsdev Thanks a lot, actually was just going to edit my own message as by the end of the video you had mentioned exactly that (the ailments of making comments without finishing the thing, my bad).
      Cheers once again.

  • @SettingUpTheChairs
    @SettingUpTheChairs Год назад +1

    Awesome vid! Is there a way to have the data sync with the apple watch using SwiftData?

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

      Thanks & yh you’ll probs want to look into using app groups to pass data between different targets 👌🏾

  • @chrisjackson9733
    @chrisjackson9733 Год назад +1

    Another great video! Was wondering if you were planning on any videos overviewing Swift Macros. I think I have a general understanding but could use a clearer explanation. How are they different from property wrappers and/or packages?

    • @tundsdev
      @tundsdev  Год назад +1

      Great suggestion, i’ll take a look into it for you 👌🏾

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

    The best content as usual. 👏🏽

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

    Lovely stuff Tunds!

  • @TheBishopOfBarton
    @TheBishopOfBarton Год назад +1

    Great video - really well explained. Thanks man.

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

      Glad you enjoyed it!

  • @juanfrancisco9039
    @juanfrancisco9039 Год назад +4

    Very nice video. Could you show how to prepopulate a database with SwiftData and use this data into relationships?

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

      Great suggestion, I’ll look into it👌🏾

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

      Firebase with Authentication would be great. 😅

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

      Already in the works, but do you have anything specific you’d like to see? 👀

    • @marclutke1900
      @marclutke1900 Год назад +1

      @@tundsdev it also would be great to have CRUD operations in it. Because in SwiftData we’re switching from structs to classes and the behavior is different when I was testing it.

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

    Thanks for the video! Would love a tutorial on using SwiftData to cache data from an API call and display it in case the user is offline; this would also help to reduce unnecessary API calls.

    • @tundsdev
      @tundsdev  Год назад +1

      I’ve already written a script 👀
      It’ll feature a timed cache, but you can easily tweak it to handle offline connectivity

  • @cloftis130
    @cloftis130 Год назад +1

    As always great video explaining a complicated topic. I do have a question…What is the key combination you use at about 17:03 mark to get the .sheet stub to change so that onDismiss is just in the closure? Thanks again Tunds.

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

      Thanks & tbh I didn’t use a special key combination, I just hit enter 😅

    • @cloftis130
      @cloftis130 Год назад +1

      @@tundsdev Cool. I didn't realize it was that simple to get the code completion to get rid of some of the options. That'll save some time. Keep up the good work.

  • @wqlu3115
    @wqlu3115 6 месяцев назад +1

    thanks man, it’s very helpful!

    • @tundsdev
      @tundsdev  6 месяцев назад

      Glad it helped!

  • @ChileMamaLC
    @ChileMamaLC 10 месяцев назад +1

    What a great t-shirt! How might folks get an updated version of this for themselves I wonder? ;)

    • @tundsdev
      @tundsdev  10 месяцев назад

      By attending one of my fave conferences 👀

  • @Itchster
    @Itchster Год назад +1

    Great tutorial and a starting point to tinker with Swift data.
    It's just a shame you can't appreciate the divine taste of a Bounty!
    😆

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

      Thanks, glad you enjoyed the vid & bounty’s aint it at all 😂

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

    Great video! Can’t wait to try this out 🔥

  • @michanierebinski1423
    @michanierebinski1423 Год назад +1

    Thanks for the vid. Quick and fun tutorial

    • @tundsdev
      @tundsdev  Год назад +1

      Glad you enjoyed this 👌🏾

  • @m3zish
    @m3zish Год назад +1

    Thanks for the video, very well explained. Not the first one I see, but the more I see, the more information I get :) Seems you have part 2 already planned, I have ideas for part 3 and maybe 4 and 5 lol :) I have an app that is using Core Data, and I could simplify it if I were to use SwiftData instead, but I haven't figured out how to "migrate" the data from Core Data to SwiftDate. I made several attempts, nothing worked, so a video showing how to migrate from one to another WITHOUT losing any data would be great! Another video would be about sharing SwiftData between iPhone main app and Watch companion app. I tried too, but it always crashes, not sure if I'm doing it wrong or if Xcode beta is unstable. Lastly: I haven't found much information on iCloud storing of the information and syncing with other devices/OSs, that would be another video to consider :) Thank again for the information so far :)

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

      Thanks, all good suggestions. So some i have planned content for, others will be part of a paid course. So just keep your eyes peeled 👀

  • @sameershaik9110
    @sameershaik9110 5 месяцев назад +1

    How do i get ur code from github?

  • @chukwumaugonabo1045
    @chukwumaugonabo1045 5 месяцев назад

    Good stuff!

  • @danuff
    @danuff Год назад +1

    Thanks for the video!

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

      Thank you for watching 🤝

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

    Brilliant mate, thanks for showing this.

  • @sxmiotb2834
    @sxmiotb2834 Год назад +1

    I love you man. Thank you so much

    • @tundsdev
      @tundsdev  Год назад +1

      Appriciate it 🫂

  • @SiamakAshrafi
    @SiamakAshrafi Год назад +1

    Great explanation ... Thanks!

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

    What is the best approach for waiting to see if the insert was correct before moving to a new screen, when there is no async/await for SwiftData? :) Thanks

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

      Not too sure on you mean by the insert being correct? As soon as you insert it’ll be in memory so the new changes will be there and automatically persisted (as long as autosave is enabled) so when you go to the next screen the object should be there already

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

      @@tundsdev hi sorry I meant success, not correct. So you do insert, but show a loading indicator whilst it does it, but also show and error if it fails? Great video! Any chance there could be a follow up syncing to cloudkit? 😇

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

      So with swiftdata inserts are so instant you probs wouldn’t even need a spinner tbh. And cloudkit will be part of my paid course 👌🏾

  • @allenwixted1992
    @allenwixted1992 Год назад +1

    At 7:14 I get a crash when adding the model and container. "Failed to find a currently active container" comes up in the preview. Any ideas?

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

      Have you set the modelContainer in the Previews? If not then you'll more than likely see this crash

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

      @@tundsdev yeah that was my first thought also. Funnily, it works from the content view when pulling up the sheet, I can see the create a task view perfectly, but not via the create view itself

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

      @@allenwixted1992 I have the same issue running Xcode 15.0.1, crashes in ModelContainer.swift, failed to find a currently active container for ToDoItem. It runs ok in the simulator. It just crashes in the preview.

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

    Very nice video. Is there a way to create a query with predicates on the fly i.e. someone choosing what field to search-by?

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

      Thanks & at this moment in time no. But if there is a way in the final release then i’ll do an updated video 👌🏾

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

      @@tundsdev I just saw this in the docs--I think it's pretty much what I was thinking about.
      let simpleFood = #Predicate { recipe in
      recipe.ingredients.count < 3
      }

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

    Hi @tundsev, did you manage to make a model both @Model and Codable at the same time?

    • @tundsdev
      @tundsdev  Год назад +1

      Yep, its coming out this sunday 👌🏾

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

    Bounty is so good thoughhhh😛(my favourite!!!) as much your video is helpful. Thank you for this amazing and well explained video☺

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

      Glad you enjoyed the video 👌🏾

  • @Pete-ek9dw
    @Pete-ek9dw 2 месяца назад

    thank you sooooo much!😀

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

    Looks like a good example for Swift Data, however I've got an error I can't get around. At about 7:40 in the CreateView file on line 14 is @State private var item = ToDoItem(). I get an error "Missing argument for parameter 'backingData' in call" Thoughts? Thanks.

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

      If you look at 2:15 have you forgot to add the default values to the initialiser?
      So when you create an instance of the the todo it doesn’t expect you to set every single param i.e title, timestamp, isCritical, isCompleted etc.
      This is what i think the problem is you’re facing

    • @evroad
      @evroad Год назад +1

      @@tundsdev That's it, Thanks!! Now I'll see if I can get a little further along tonight!

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

    Do you have any videos on developing an app with the open ai GPT API?

  • @ratatata6611
    @ratatata6611 5 месяцев назад

    Subbed!

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

    Would someone help me with the logic of deleting an item in the details view.
    I’m talking about my code, not his code.
    When I delete in the main view, it’s fine. But obviously, in the detail view, when you delete the item, you’re working with, the controls can’t update, because there’s no item any longer.
    It deletes fine, but then I get an error. What I really want, is to delete it, and go back to the main view. But it doesn’t work. I know about dismiss, and that works (when I’m not deleting an item)
    I can’t get deleted, and dismissed to work together without an error.
    Thanks so much

    • @tundsdev
      @tundsdev  Год назад +1

      Hey, so when you call the dismiss function right after delete. What error are you getting? This should work which is weird

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

      @@tundsdev Thanks for getting back to me.
      I’m at work now. I’ll edit this text with the error message when I get home.
      Wait a sec. I’m a NOOb.
      I don’t remember seeing an error.
      I think it went back to the “main” view and it was just blank screen.
      Anyway I’ll get back to you.
      I’m not good at seeing errors in the list at bottom, yet.

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

      @@tundsdev
      Ok I made a YT vid for ya explaining it a bit:
      ruclips.net/video/kggOPPMKmVs/видео.html

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

    At this point would your bother learning core data or focus your energy in swiftdata?

    • @tundsdev
      @tundsdev  Год назад +1

      I do think SwiftData is great, there’s still a few things that need ironing out. But my personal apps will all be using SwiftData going forward, WWDC24 is where I think it will be standard imo

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

    I've been using structs extensively.. because it was recommended to use codable structs instead of classes.. now do I have to switch everything to classes? Struct just went out of trend?

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

      Apple recommends using classes in all of their sample code, probably because of the changes they’re made with the new Observation framework. For Models with SwiftData i’d stick to using classes 👌🏾

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

    is it possible to have multiple sort options? on the @Query at the same time i.e I want to sort by name but if they are the same then use the time

    • @tundsdev
      @tundsdev  Год назад +1

      So at the moment in time nope, it's not possible since you can only define a keypath on a property and sorting direction. If you wanted to do that you'd be better off copying what i did with my filter logic in this video so it can dynamically filter and sort the data or file a feedback with Apple so they can add this an improvement.

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

    Hello!
    How do we write unit tests for SwiftData?

    • @tundsdev
      @tundsdev  Год назад +1

      This will be part of a paid course i’m working on, i still need to research/look into it

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

    In the WWDC keynote about making an app with SwiftData they used the @Bindable and they were able to save directly to the object, I tried doing the same but it doesn't like that for the Preview Window because the Bindable object (the object you're trying to persist) isn't initialized. Do you know anything about that?

    • @tundsdev
      @tundsdev  Год назад +1

      So i actually have a video planned bout working with the new Preview macro & SwiftData coming out pretty soon to show you how to tackle this 👌🏾

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

    Have you noticed the Missing argument for parameter 'backingData' in call whenever making the @State property in 6:38? I imported SwiftData and declared a modelContainer in the Preview. Unsure what's happening

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

      I have not noticed that error with the Xcode15 beta. Maybe give the project a clean, clear derived data, also in the description box is the complete project so you can compare.
      But i’ve not used that backingData property, since i have a init where i set the default params for each property so I can just create an empty to do 👌🏾

    • @franksolleveld2909
      @franksolleveld2909 Год назад +1

      @@tundsdev yeah i noticed your init aswell. Filed a bug report for it, will remove it if I noticed something i did that caused it 😂

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

      I’m curious if my final project has the same issues on your machine 👀

    • @franksolleveld2909
      @franksolleveld2909 Год назад +1

      Apparently I had to make it private ;-)

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

      @@tundsdev Just out of curiosity since I faced the same issue when not having default values, why does this happen? Is this intentional?

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

    is "TodoItem with @Model" still a class ?
    I saw you use @State.
    I am confused why it doesn't use @StateObject.

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

      Reason why is because @Model is built ontop of the new @Observable macro which is only meant to be used with @State.
      It’s part of the new SwiftUI data flow coming in iOS 17 that works with classes for observing data. I’ll have a video out for it pretty soon 👌🏾

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

    Hi Also get errors when I update the ContentView about 9:50 into the video. please help

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

      Hey, you’ll need to be a bit more specific what errors are you getting?

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

    Question: if we create a @Model class with a custom struct as an attribute, and save this as an array (e.g. class Item { var details: [Detail] } ) how is this saved in the underlying Core Data? It sounds like an equivalent of a one-to-many relationship, but without a second object; which I can't wrap my head around

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

      Based on what you’re saying you’d possibly want to create a relationship between the two, using the relationship macro.
      I actually have a script/vid planned to show this, but currently in the first Xcode 15 bets deletes with relationships crash at lot.
      Once that is more stable I will release the vid, since it goes over one to many relationships 👌🏾

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

      @@tundsdev I understand we can create a one-to-many relationship using a macro. My question is more about the new composite attributes, and whether they can replace a to-many relationship. Another example: class Car { var wheels: [Wheel] }, where Wheel is not another class, but a struct, and saved (somehow) as a composite attribute.

    • @tundsdev
      @tundsdev  Год назад +1

      Ahhhh ok got you, so I saw this in the modelling your data video. I’m not too sure on the benefits/differences something i’d have to explore and checkout myself since its still early days
      I have a project where i can mess around with your example let me play around & find out for you? 👀

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

      @@tundsdev that would be amazing, thanks! IF this is possible, it could be important, because we could replace a to-many relationship and therefore avoid faulting a second table into memory when fetching. This could result in significant performance gains for large datasets.

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

      So i’ve not tested it yet. But been compiling code in my brain 😅
      And I think what would happen is that you’d basically have the data associated with the model. But I do think the model would have to be a codable, since you’re not defining another model. My guess would be SwiftData would just flatten it and save it.
      I think examples like where a to do could have a category you probs wouldn’t want to do this since you’d want a model where you can query all categories.
      If you had them all associated with a model as an array of structs you’d have to get all the to do’s and then the categories in them you can see where the problem is starting. So those relationships help with maintaining data integrity.
      I do think it would be useful for things like configurations i.e lets say a to do had a set of configurations like priority, tags, location to trigger etc. Since you dont need to query stuff like this.
      These are my thoughts/thinking

  • @celicagirls
    @celicagirls 7 месяцев назад

    Hi at 7:14 i get a preview crash even after adding the model container has anything been updated since this was made thanks.

    • @tundsdev
      @tundsdev  7 месяцев назад

      Hi, this video was created during the beta. So there are a few changes around previews but everything else is still valid. One thing I would say is in the course you should look at the previews videos in it. And check out the sample code too in the description box 👌🏾
      SwiftData Todo List App | SwiftData For Beginners | SwiftData In SwiftUI
      ruclips.net/p/PLvUWi5tdh92wZ5_iDMcBpenwTgFNan9T7

    • @celicagirls
      @celicagirls 7 месяцев назад

      @@tundsdev Hi thanks will have a look at the previews videos much appreciated.

    • @tundsdev
      @tundsdev  7 месяцев назад

      Also pls check out the starter and final source code for the course especially the previews folder 👌🏾
      github.com/tunds/youtube-content-2023

  • @qianqian888
    @qianqian888 Год назад +1

    thank you~

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

      Thank you for watching 👌🏾

  • @Spacer-l3j
    @Spacer-l3j 9 месяцев назад

    very good bruder

    • @tundsdev
      @tundsdev  8 месяцев назад

      Nice one brudda

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

    Thank, Tunds!

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

      No, thank you for watching 🫂

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

    C'mon, I like Bounty! 😆

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

      *Shakes head in disappointment*

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

    👍👍 + 2 jam butties

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

      You're a man of good taste 🤝

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

    How dare you diss bounty!! Unsub nowwww

  • @maartenborsje
    @maartenborsje Год назад +1

    Error: Cannot infer type of closure parameter '$0' without a type annotation
    Can be resolved by changing:
    @Query(
    filter: #Predicate { $0.isCompleted == false },
    sort: \.timestamp,
    order: .reverse
    ) private var items: [ToDoItem]
    to
    @Query(
    filter: #Predicate { $0.isCompleted == false },
    sort: \.timestamp,
    order: .reverse
    ) private var items: [ToDoItem]

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

      Thanks Maarten

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

      👌🏾should also be in the pinned comments too

  • @LebenWerden
    @LebenWerden 7 месяцев назад

    Hello, what about
    @StateObject
    @ObservedObject
    @Binding
    @EnvironmentObject
    @Published
    Better avoiding them?

  • @teakodo
    @teakodo 8 месяцев назад

    For those getting
    Cannot infer type of closure parameter '$0' without a type annotation
    you need to add or in the video's case
    @Query(
    filter: #Predicate { $0.isCompleted == false },
    sort: \.timeStamp,
    order: .forward
    ) private var items: [Item]

    • @tundsdev
      @tundsdev  8 месяцев назад +1

      I added a pinned comment & this to the description explaining this btw, it was a change made during one of the xcode betas 😅

    • @teakodo
      @teakodo 8 месяцев назад

      @@tundsdev thank you ! didn't see my bad

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

    specific

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

    Hi Great work! I am using XcodeI 15.0 and I am having an issue on the #Preview when I add the '.modelContainer(for: ToDoItem.self)' in the CreatView file?
    The error Xcode gives me is this:
    MyToDos crashed due to fatalError in ModelContainer.swift at line 144.
    failed to find a currently active container for ToDoItem
    Does anyone know how to fix this please or is it a bug?
    Thanks

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

      Hmm that should work, can you check out the free source files to compare what may be different and also make the changes that I pinned in the comments section on this video too.
      github.com/tunds/youtube-content-2023/tree/main/SwiftData%20Is%20Way%20Easier%20Than%20CoreData%20😇%20%7C%20Build%20A%20Todo%20app%20using%20SwiftData
      I also have another video which you should check out which goes over a better way of handling SwiftUI previews with SwiftData
      ruclips.net/video/jCC3yuc5MUI/видео.html
      Hope this helps

    • @romanyefimets454
      @romanyefimets454 8 месяцев назад

      i seem to have the same error, anyone figure it out?

    • @tundsdev
      @tundsdev  8 месяцев назад

      Hey you’ll 100% want to check out my video that goes over working with SwiftData and the Previews which covers an even better way of handling this the link is above ☝🏾

    • @romanyefimets454
      @romanyefimets454 8 месяцев назад

      @@tundsdevnot sure which video you are referring to, i see links to the playlist.

    • @tundsdev
      @tundsdev  8 месяцев назад

      @romanyefimets454
      How To Use SwiftData with Preview | SwiftData Tutorial | #10
      ruclips.net/video/jCC3yuc5MUI/видео.html

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

    Good Tutorial. NavBarTitle not showing up on edit view. Small thing...$0.isCompleted == false ; Simpler ==> !$0.iscompleted.

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

      Thanks & I actually prefer explicitly stating the condition its way more readable imo 👌🏾

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

      Also with the Title bar not showing up, I just forgot to add the NavigationStack. You can easily add that in if you want too 👌🏾

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

      Too many years of Oracle for me. Now I have to get used to this way of doing things...although SwiftData is a lot better than CoreData@@tundsdev

  • @iwy2th
    @iwy2th Год назад +1

    thank !!!From Viet Nam !

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

      Thank you, glad you enjoyed it 👌🏾