Тёмный

3. SwiftData Dynamic Sorts and Filters 

Stewart Lynch
Подписаться 21 тыс.
Просмотров 6 тыс.
50% 1

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

 

15 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 47   
@StewartLynch
@StewartLynch 11 месяцев назад
To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/StewartLynch . The first 200 of you will get 20% off Brilliant’s annual premium subscription.
@larryburris6761
@larryburris6761 10 месяцев назад
Excellent tutorial series! I really like the fact that you point out the compilation issues presented when doing the refactoring, what the error messages actually mean and the steps to perform to fix the problems. Sometimes the error verbiage is not very helpful but you do a great job explaining things in a way that everyone can understand. Looking forward to the next section of videos!
@Yannemal
@Yannemal 10 месяцев назад
these first 3 in this SwiftData were fantastic for comparing to everything I had learned in CoreData recently. Most of the tutorials I had used being a few years old I was happy to see so many little newer features of iOS17 sprinkled all over !
@dibjr
@dibjr 10 месяцев назад
Thank you, Stewart! Great video! I can't help but reflect on the ability to do iterative development these days, while remembering the old days with pencil writing code, punching cards, and iteratively submitting batch jobs until you get something that would compile, let alone do anything useful.
@norahn7863
@norahn7863 10 месяцев назад
Thank you for amazing video✔️ Your channel are always valuable, and I benefit from them.
@StewartLynch
@StewartLynch 10 месяцев назад
Happy to hear that!
@andrejkling3886
@andrejkling3886 10 месяцев назад
Amazing series Stewart 💯✅. Thank you so very much ✨✨✨
@vladimirmoor
@vladimirmoor 29 дней назад
Thanks a lot for this videos! So detailed explanation ❤
@StewartLynch
@StewartLynch 28 дней назад
You're welcome 😊
@larschristiansen3136
@larschristiansen3136 10 месяцев назад
Great third part. But swift gets quite messy, I would love to see some guidelines/best practices on the topic. It does seem that SwiftData is closely related to CoreData.
@DavidKoontz
@DavidKoontz 8 месяцев назад
Sort & Filters are very powerful... I'm sure we could go way further down that path.
@BillySangster
@BillySangster 10 месяцев назад
Excellent series so far, thanks Stuart. 🙂 Are you going to cover mirroring SwiftData with CloudKit? I’d love to know if you found a good way to tell when CloudKit has finished syncing (for pre-loading some data on a new device purposes). I’m finding that a bit tricky.
@StewartLynch
@StewartLynch 10 месяцев назад
The last video in this series covers CloudKit. I do not, however, get into what you are looking for.
@LG-ve9us
@LG-ve9us 4 месяца назад
Great series... I tried filtering on a value such as book then tried to do an inline edit of the list but when I do this it changes the filter and my item disappears from my list... is there a way to do the filtering and also inline edit of the list item? Just to be a little more specific, if I query on the author name but then realize I misspelled the author's name and try and change the name, the item disappears from my list because the authors name no longer fits my filter... If I did a delete on the name to change it then the book now has no author listed in my model... hope that makes sense. Thanks a lot for this series!
@AndrewDChristie
@AndrewDChristie 8 месяцев назад
Thanks!
@StewartLynch
@StewartLynch 8 месяцев назад
Thank you
@mkhasson97
@mkhasson97 10 месяцев назад
Thank you so much for this series😊
@LG-ve9us
@LG-ve9us 4 месяца назад
Thanks!
@StewartLynch
@StewartLynch 4 месяца назад
Thank you so much
@gregh528
@gregh528 10 месяцев назад
Fantastic video thanks Stewart.
@ChristopherJRoura
@ChristopherJRoura 7 месяцев назад
In the current implementation you can either show in shelf -> in progress -> completed or the reverse. How could you filter just a specific status like in progress? Is it possible to do with an enum?
@StewartLynch
@StewartLynch 7 месяцев назад
I think you would have a problem with the Query macro so you would have to convert the results to an array and use a .filter
@phisakel1
@phisakel1 Месяц назад
Ευχαριστούμε!
@StewartLynch
@StewartLynch Месяц назад
Thank you
@AkimboFennec
@AkimboFennec 5 месяцев назад
I have a question. When i have a model class called Destination. It has as one of the properties : var city: String. I decorate this to be unique with @Attribute(.unique) so that if someone tries to insert a new Destination with the same city name, the model will simply be updated, and not duplicated. However, when i tested it, there was a crash. Swift data crashes every time a duplicate is inserted. Why is this happening? How come an app crash as soon as you decorate something with unique attribute. ??
@StewartLynch
@StewartLynch 5 месяцев назад
Could be a SwiftData bug. I never use this and always would check using a contains code check. As far as destinations go though, there are many cities with the same name.
@AkimboFennec
@AkimboFennec 5 месяцев назад
@@StewartLynch Thanks. I thought that it should work to be honest
@joser.oleriano2148
@joser.oleriano2148 10 месяцев назад
Amazing Video! Great👏👏
@StewartLynch
@StewartLynch 10 месяцев назад
Glad you liked it!
@scroot485
@scroot485 8 месяцев назад
Are you certain it’s safe to access the query object directly using the _ version of the name, as in _books = Query(…. ? That seems a lot like a private implementation detail that isn’t intended to be stable. It also seem to be undocumented. I’m glad you demonstrated this technique but it’s unclear whether it’s a good practice or not.
@StewartLynch
@StewartLynch 8 месяцев назад
That is not private. The _ is how you can update a query on initialization. It is how Apple does it in their sample project too. It is the only way to do it AFAIK
@scroot485
@scroot485 8 месяцев назад
If Apple does it in their sample project then it’s good enough for me. Thanks for the reply and the excellent series!
@accoTV
@accoTV 10 месяцев назад
Great video series 👍, if I wanted to remember my preferred sort method, each time I opened the app, how might I do that. Ps sorry if I missed it in the video if its already there.
@StewartLynch
@StewartLynch 10 месяцев назад
you could persistent your choice to App storage
@jasonzheng5454
@jasonzheng5454 8 месяцев назад
Can't sort by enum even when it conforms Comparable, thus can only store the raw value, it's sad.
@StewartLynch
@StewartLynch 8 месяцев назад
You could fetch all and do an in memory sort. Not ideal, but doable.
@jasonzheng5454
@jasonzheng5454 8 месяцев назад
@@StewartLynch I see, thanks a lot.
@victorriurean
@victorriurean 10 месяцев назад
@gakkieNL
@gakkieNL 4 месяца назад
Remind me; why do we need the tag in the picker selection ?
@StewartLynch
@StewartLynch 4 месяца назад
If you give me a time stamp, I will take a look. It is likely because what you are displaying in the list is to the entire object
@gakkieNL
@gakkieNL 4 месяца назад
@@StewartLynch In BookListView: Picker("Sort", selection: $sortOrder) { ForEach(SortOrder.allCases) { sortOrder in Text(sortOrder.rawValue) .tag(sortOrder) } }
@StewartLynch
@StewartLynch 4 месяца назад
@@gakkieNL Right. You are displaying only the rawValue of the sort order in the picker, so you want to ,are sure that when you select one, it is the actual sortOrder that is bound to the variable, so that is why you need the tag.
@gakkieNL
@gakkieNL 4 месяца назад
@@StewartLynch thanks. Crystal!
@OttoFaerber
@OttoFaerber 10 месяцев назад
Many thanks for the great Videos. Unfortunately, swiftdata is still far too cumbersome. It was much better many years ago in other programming languages. Maybe one day Apple will manage to integrate a good "real" sql database into SwiftUI
@AndrewDChristie
@AndrewDChristie 8 месяцев назад
Thanks!
@StewartLynch
@StewartLynch 8 месяцев назад
Thank you
Далее
4. SwiftData Lightweight Migrations
13:13
Просмотров 4,1 тыс.
5. Swift Data One to Many Relationships
25:58
Просмотров 8 тыс.
Раскрыла секрет дочки!
00:37
Просмотров 335 тыс.
8. SwiftData   CloudKit
18:20
Просмотров 7 тыс.
6. Swift Data Many to Many relationships
35:20
Просмотров 5 тыс.
9. SwiftData Storing Images and Bug Fixes
23:15
Просмотров 4 тыс.
7. App Localizations
18:25
Просмотров 4,8 тыс.
Image Carousel in SwiftUI
18:27
Просмотров 2,3 тыс.
Раскрыла секрет дочки!
00:37
Просмотров 335 тыс.