How To Use JSON To Preload SwiftData ModelContainer 👀 | SwiftData Tutorial | #6

  Рет қаралды 4,203

tundsdev

tundsdev

Күн бұрын

Пікірлер: 28
@mauricederegt
@mauricederegt 9 ай бұрын
Thank you for this tutorial, it was very handy. One question though, what to do if you want to UPDATE your data. Let's say you want to add another category when your app is already installed?
@tundsdev
@tundsdev 9 ай бұрын
Glad you enjoyed it 👌🏾 & you can just perform normal crud. I cover this in this video here. SwiftData For Beginners: How To Build A To-Do List App In SwiftUI | #1 kzbin.info/www/bejne/oX2xf4GOeZ2LaLc
@mauricederegt
@mauricederegt 9 ай бұрын
@@tundsdev Cool thanks!
@jaimeacasta
@jaimeacasta 2 ай бұрын
Amazing video! Greatly explains, however I've got a question... I tried this and the preload works, however, it preloads the data randomly. I want the data array in a certain order. I tried adding a "order" constant to the CategoryResponse and sort the array just before spending to context but this doesn't work. Did you figure out how to get the preloaded array sorted?
@cinnamonrage
@cinnamonrage Жыл бұрын
Thank you for this!!!
@tundsdev
@tundsdev Жыл бұрын
Glad you enjoyed it 🤝
@Justin-BroskiMode
@Justin-BroskiMode 9 ай бұрын
Thanks this was useful and go arsenal! respect.
@IbrahimAkar
@IbrahimAkar 10 ай бұрын
This was extremely helpful - thank you. I have managed to get the container built and my JSON file imported OK. However, I have six JSON files to load and I was wondering if I have to create a function for each import or is there a way to import all six with one function call
@tundsdev
@tundsdev 10 ай бұрын
Glad to hear it helped, yep you’re going to need load each file separately 👌🏾
@DolHarubang-swift
@DolHarubang-swift 8 ай бұрын
Thanks very helpful video
@munavarpm5342
@munavarpm5342 Жыл бұрын
Thanks bruhh for the content
@tundsdev
@tundsdev Жыл бұрын
Glad you enjoy it 👌🏾
@claudiocavalli517
@claudiocavalli517 Жыл бұрын
thanks for all these interesting videos, did you happen to see the new apple openapi generator presented at wwdc? It would be nice to see some evidence of use.
@tundsdev
@tundsdev Жыл бұрын
Glad you found it useful 👌🏾 & nope I haven’t but I can check it out for sure 👀
@MrKamalAit
@MrKamalAit Жыл бұрын
Do you have a video where you explain the same thing but for Core Data? please keep up the good work 👍
@tundsdev
@tundsdev Жыл бұрын
Thanks & I don’t but I can create one 👌🏾
@MrKamalAit
@MrKamalAit Жыл бұрын
@@tundsdev Thank you bro, I’m currently struggling to preload data into my app following your video, I setup the json file with its respective model, but got stuck knowing how to map it to CD.
@kevinkivo
@kevinkivo Жыл бұрын
Thanks so much for this video! I have been playing with SwiftData for a couple months with limited success. I was hoping someone could help with how to enable SwiftData's undoManager... If you are calling the container.create() function in your WindowGroup in the app.swift file, how can you set the isUndoManagerEnabled argument to true? I can't figure out where this would go. It's not a parameter in ModelConfiguration() or in ModelContainer(). It's only available with conformance to Scene, but if I call my custom Container within the App Scene, I cannot add isUndoEnabled without getting the error 'No exact matches in call to instance method 'modelContainer''
@simonransom_dxb
@simonransom_dxb 8 ай бұрын
Hello Is it possible to create a Button in our App to "repopulate" sample data that the User may have deleted? I know we can toggle the ShouldCreateDefaults but that would then require a restart for the user to get the Sample Data... can we do it without an App restart is the question? I am thinking I could put a button in my Setting view for the user to recreate Sample data, just in case. Thanks in advance, Simon
@haydgately2109
@haydgately2109 Жыл бұрын
Would this work if it was getting initial config from a network request that returned the JSON instead of loading it from local? Some sort of loading state would be needed I think
@tundsdev
@tundsdev Жыл бұрын
Yep it would work, and I have a video course coming very soon that shows you how to do this also 👀
@haydgately2109
@haydgately2109 Жыл бұрын
@@tundsdev Amazing! Thanks so much for the great video and amazing comms as always ☺️
@kichuntse4746
@kichuntse4746 2 ай бұрын
What if i want to preload some images into the model? And the user can also further add images into the model
@iamcodfish
@iamcodfish Жыл бұрын
Would I be possible to share the code snippet that would pre fill some default ToDo items please?
@tundsdev
@tundsdev Жыл бұрын
I have a video for this pretty soon that shows you how to prefill data where there are relationships, that will cover having some default to dos 👌🏾
@cinnamonrage
@cinnamonrage Жыл бұрын
Will this work with nested models in JSON just as well?
@tundsdev
@tundsdev Жыл бұрын
As long as you handle the mappings side of things, it should do yep
@zainmehar2229
@zainmehar2229 Жыл бұрын
sir can you plz help me I am a junior IOS Developer. My Company assigns a task. I am working on Mobile App which uses Realm to store data locally the task is daily at night 11 pm I have to send Local data from one table to Server through API I am trying silent push notification to accomplish this task but unfortunately, sometimes it delivers notification and some time, not its not a good solution can you plz tell me how I can achieve it??
SwiftData Migrations | SwiftData Tutorial | #11
32:24
tundsdev
Рет қаралды 4,6 М.
Elza love to eat chiken🍗⚡ #dog #pets
00:17
ElzaDog
Рет қаралды 24 МЛН
Walking on LEGO Be Like... #shorts #mingweirocks
00:41
mingweirocks
Рет қаралды 6 МЛН
Perfect Pitch Challenge? Easy! 🎤😎| Free Fire Official
00:13
Garena Free Fire Global
Рет қаралды 74 МЛН
How to Load Data From a JSON File Into Your App | Swift 5 in Xcode 11
26:01
SwiftUI API / JSON Tutorial with Async Await Example
9:52
Logan Koshenka
Рет қаралды 26 М.
CloudKit - Intro, Pricing, Terms, & Definitions
17:26
Sean Allen
Рет қаралды 23 М.
SwiftData Basics in 15 minutes
15:18
CodeWithChris
Рет қаралды 49 М.
How To Use SwiftData with Preview | SwiftData Tutorial | #10
26:16
Elza love to eat chiken🍗⚡ #dog #pets
00:17
ElzaDog
Рет қаралды 24 МЛН