Тёмный

2. SwiftData Containers and Preview Data 

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

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

 

15 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 37   
@larschristiansen3136
@larschristiansen3136 10 месяцев назад
Great explanation of the notion of containers, schemas and configs. Quite comparable to CoreDate at this point. As usually Stewarts development is a great learning experience. On to the next one.
@StewartLynch
@StewartLynch 10 месяцев назад
Glad it was helpful!
@gakkieNL
@gakkieNL 4 месяца назад
Great way of providing an in memory container and sample data! Love it!
@donovanh
@donovanh 10 месяцев назад
This is exactly what I need. Thank you Stewart!
@patgoo2
@patgoo2 11 месяцев назад
Great tutorial, the Preview Containers, and Mock Data are very helpful when working with SwiftData.
@StewartLynch
@StewartLynch 11 месяцев назад
Glad it was helpful!
@BromBarium
@BromBarium 9 месяцев назад
Hi Stewart, I just wanted to say thank you! With you expertise and you nice way to explain things you're helping me very much! Keep up the exceptional work, you are one of a kind here on youtube!
@StewartLynch
@StewartLynch 9 месяцев назад
Thank you
@bugsyace
@bugsyace 8 месяцев назад
Thank you for showing the retrieval from git hub in the beginning
@andrejkling3886
@andrejkling3886 10 месяцев назад
Amazing content…💯 thank you Stewart
@StewartLynch
@StewartLynch 10 месяцев назад
Glad you enjoyed it
@mkhasson97
@mkhasson97 10 месяцев назад
Many thanks, great tutorial
@joser.oleriano2148
@joser.oleriano2148 10 месяцев назад
Great explanation! Thanks for video...
@DavidKoontz
@DavidKoontz 8 месяцев назад
ah - I followed but was not quite sure where we were going with that video... think I will have to come back to this one later.
@mario_luis_dev
@mario_luis_dev 2 месяца назад
Hey Stewart, has the behavior regarding persistance of enums in SwifData changed recently? In the application I'm working on I have an enum that has String as rawvalues, and String is precisely the type I see on my database table without having to have set .Rawvalue in the stored property inside the model class
@StewartLynch
@StewartLynch 2 месяца назад
That sounds great. I have not checked recently
@gustavomonge1785
@gustavomonge1785 10 месяцев назад
Thanks. Great Job!
@holycrosscv
@holycrosscv 10 месяцев назад
Most excellent Stewart. Thanks for this great continuing training. One question, though: does the rating in the preview match the rating on the simulator? In my code, I notice the preview rating is one less star. Thanks.
@StewartLynch
@StewartLynch 10 месяцев назад
I cover this in a later video. This is not a particularly good example. In my next series on Source control, I recreate it better
@holycrosscv
@holycrosscv 10 месяцев назад
@@StewartLynch thanks Stewart. I look forward to future installments.
@michaelhalley-frame3328
@michaelhalley-frame3328 22 дня назад
Great tutorial, thank you! One error I get is that I’m using I/O on main thread. Any guides on refactoring to avoid this?
@StewartLynch
@StewartLynch 21 день назад
Do you get this error when you are executing the code from my repository? If so, can you tell me exactly when this happens in the video?
@michaelhalley-frame3328
@michaelhalley-frame3328 20 дней назад
@@StewartLynch I’ve gone back to it tonight and it’s completely resolved. It was an error next to the struct AppName: App { line. Probably ok, just got me wondering if this pattern needed to consider performance for a real world app. Thank you for taking the time to reply!
@jousufjacob8251
@jousufjacob8251 8 месяцев назад
hi, my preview has crashed when i insert the mock data to the app, have any tips ? thanks
@StewartLynch
@StewartLynch 8 месяцев назад
Compare your code to the my completed branch on my Git repository. You might also do a Command SHift K on Xcode. That sometimes clears up issues in Preview too.
@aleksandertesenkov1421
@aleksandertesenkov1421 8 месяцев назад
Great video. Works as a charm except when I try to archive the product, the compiler throws the error “No exact matches in call to initializer”. After I clicked on error the XCode navigates me to the #Preview section. The error disappeared and grey message “Candidate has partially matching parameter list…” appears instead. This behaviour prevents the deployment. Any suggestion will be highly appreciated.
@StewartLynch
@StewartLynch 8 месяцев назад
I fix this issue in the final video
@HrishikeshMuruk
@HrishikeshMuruk Месяц назад
How does one view the documentation like you showed at 3:51 ?
@StewartLynch
@StewartLynch Месяц назад
Help Menu -> Developer Documentation in Xcode. You can search in there to find what you want.
@monoeilouais8201
@monoeilouais8201 5 месяцев назад
Amazing Stewart ! I'm in getting skills in iOS dev and it help me a lot ! Maybe a stupid question, but I want to save settings of app in iCloud, therefore I expected to save the in swift data. So I will have to create a new Model. therefore, how to handle different models in a preview. Maybe there is something I don't understand. Thanks again !
@StewartLynch
@StewartLynch 5 месяцев назад
I don’t understand the question. Your modelContainer will contain all models that you have.
@monoeilouais8201
@monoeilouais8201 5 месяцев назад
@@StewartLynch Thanks Stewart. I added my new model in the schema of the init method to add it to the container: let schema = Schema([Entry.self, AppSettings.self]) It works well. It's just about Preview. #Preview { let preview = Preview(Entry.self, AppSettings.self) preview.addExamples([Entry.sampleEntries), AppSettings.sampleAppSettings]) return Home() .modelContainer(preview.container) } I get error at #Preview level : "Type of expression is ambiguous without a type annotation"
@AndrewDChristie
@AndrewDChristie 7 месяцев назад
Thanks!
@StewartLynch
@StewartLynch 7 месяцев назад
Thank you
@cuentayt-nh9qn
@cuentayt-nh9qn 3 месяца назад
ty crack
@hekuli
@hekuli 8 месяцев назад
The preview thing is a handy trick, but it doesn't work when you have nested models. Like a parent model that has an array of child models. Because it seems like all children need to be insert()'d or save()'d first otherwise SwiftData crashes.
@StewartLynch
@StewartLynch 8 месяцев назад
Keep watching the series. I believe I cover this when I do relationships. Also. Get this book. www.bigmountainstudio.com/swiftdata/77jt8
Далее
3. SwiftData Dynamic Sorts and Filters
18:50
Просмотров 6 тыс.
8. SwiftData   CloudKit
18:20
Просмотров 7 тыс.
Тарковский - гений
00:48
Просмотров 461 тыс.
SwiftUI Card View - Group Box & Customizations
10:21
Просмотров 15 тыс.
Rain Particle Effect with SwiftUI
6:44
Просмотров 137
1. SwiftData CRUD Operations
42:40
Просмотров 26 тыс.
Concurrency of SwiftData, by Donny Wals (English)
31:08
Building a Mock API in React
12:26
Просмотров 10 тыс.
9. SwiftData Storing Images and Bug Fixes
23:15
Просмотров 4 тыс.
iOS 17 Data Flow with Observation Framework
28:41
Просмотров 8 тыс.
Channel Review for 2023/24
6:05
Просмотров 635