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!
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.
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 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!
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
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.
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.
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 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"
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.
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!
Thank you
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.
Glad it was helpful!
Great tutorial, the Preview Containers, and Mock Data are very helpful when working with SwiftData.
Glad it was helpful!
Great way of providing an in memory container and sample data! Love it!
Thank you for showing the retrieval from git hub in the beginning
This is exactly what I need. Thank you Stewart!
Amazing content…💯 thank you Stewart
Glad you enjoyed it
Many thanks, great tutorial
Great explanation! Thanks for video...
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.
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
@@StewartLynch thanks Stewart. I look forward to future installments.
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.
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?
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?
@@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!
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
That sounds great. I have not checked recently
Thanks. Great Job!
hi, my preview has crashed when i insert the mock data to the app, have any tips ? thanks
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.
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.
I fix this issue in the final video
How does one view the documentation like you showed at 3:51 ?
Help Menu -> Developer Documentation in Xcode. You can search in there to find what you want.
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 !
I don’t understand the question. Your modelContainer will contain all models that you have.
@@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"
Thanks!
Thank you
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.
Keep watching the series. I believe I cover this when I do relationships. Also. Get this book. www.bigmountainstudio.com/swiftdata/77jt8
ty crack