No cap one of THE best tutorials on swiftdata migration/versioning
@Kontrbandist
5 ай бұрын
Hey mate, thanks for the tutorial, finally got a better understanding about Migration which been struggling. Cheers!
@tundsdev
5 ай бұрын
Glad it helped!
@andrejkling3886
9 ай бұрын
Best series on Tube...💯🔥 thanks a lot Tuns 🥇
@robertj1679
4 ай бұрын
DUDE! Thank you SO much for this video so many other tutorials do not address handling multiple models!
@tundsdev
4 ай бұрын
Glad it helped!
@mullassery
7 ай бұрын
Excellent video. No fluff; all value 👌
@tundsdev
7 ай бұрын
Glad you enjoyed it!
@maryannadelman4438
5 ай бұрын
I have an app that has a watch component. Both watch and phone have the same SwiftData Model for persisting data. I’ve been searching on how to have the data that the user stores on the watch able to be sent to the phone so they can have it on their phone for comparison. Hope that makes sense. I’m a relative newbie but have learned a lot through people like you.
@tundsdev
5 ай бұрын
Hey. I feel like you want to enable App Groups on your SwiftData model to share the data between two devices. I’d look into using app groups with SwiftData 👌🏾
@bscheirman
11 ай бұрын
You had me at 2Pac and lost me at McDonald’s 😂
@tundsdev
11 ай бұрын
McDonalds is easily the creme de la crem of fast food 🤷🏾♂️
@avgeekguy
11 ай бұрын
Could you do a video on how to do alternate app icons and have the user select which one they want? Great video as always!
@tundsdev
11 ай бұрын
Cool idea for sure 👌🏾
@dmacharo
7 ай бұрын
Man this is absolute gold! Thanks heaps!
@tundsdev
7 ай бұрын
Glad you enjoy it 👌🏾
@dmacharo
7 ай бұрын
@@tundsdev, if we are changing only one model, should we include all models in the migration or just the one? I am getting a crazy error "Cannot use staged migration with an unknown coordinator model version." and not sure what else to try!
@tundsdev
7 ай бұрын
@dmacharo You need to copy everything over, migrations can be a bit flaky in swiftdata i’ve realised even adding a transformable property or enums can make your app crash… So for now i’d make the models like for like 👌🏾
@RyanTaylorGT
Ай бұрын
Super helpful, thank you!
@tundsdev
Ай бұрын
Glad it was helpful!
@lib9892
10 ай бұрын
Thank you so much for all you done, it's very helpful for me! Liked, subscribed and commented!
@user-jz8op2dc4e
2 ай бұрын
Very detailed tutorial 👍
@federicoramos
2 ай бұрын
I've been getting an exception "Thread 1: "The current model reference and the next model reference cannot be equal." Does anyone have a suggestion?
@user-zl6qv9vn1z
5 ай бұрын
Subject suggestion: Transferring SwiftData model from watch to phone. I could definitely use a tutorial on that one!
@tundsdev
5 ай бұрын
Can you explain this one a bit more?
@Artifismo
6 ай бұрын
My Application Support is Empty after adding some records.
@aprilzoo9561
11 ай бұрын
Hey, love you vids: ) Have you considered doing a video explaining the sample code project Backyard Birds from Apple? I'd love to get your take on why the app is setup the way it is: - multiple ViewModifiers - instance of the DataGeneration - Account setup - StoreKit I'm especially interested in what exactly happens, when the app is launched for the first time and how the subsequent app launches are handled. Take care : )
@tundsdev
11 ай бұрын
I’ve not actually, but do you mean like a code review? It’s something i could do & consider for sure 👌🏾
@aprilzoo9561
11 ай бұрын
Yes! Apple has multiple videos, where they explain things like storekit or widgets using Backyard Birds. However, there aren't any good resources on how the app actually works and why certain design decision were made@@tundsdev
@tundsdev
11 ай бұрын
Cool for sure i’ll look into it, great suggestion 👌🏾
@mikehimself909
11 ай бұрын
Thank you for this great video. A question on your versioning: Even though your renaming of ‘timestamp’ to ‘due date’ is small, it is a breaking change. If I’m running the app on two devices, and I update one of them to the latest version and run it, then the MySQL database will have the renamed column/property. The other device will or should fail (since it can’t find ‘timestamp’). Ideally, the other one would get an exception like ‘you must upgrade to the latest version before running this app’. Do you know if changing major or minor versions will prevent incompatible versions from accessing the database after it’s upgraded?
@tundsdev
11 ай бұрын
👋🏾 technically it shouldn’t be a problem since this isn’t like MySQL. The persistent storage isn’t on a server its local to the device so you’d be ok using the app until you updated it to a later version. It’s only when you update the app the migration would happen, and this then would perform either a lightweight or heavyweight migration for you 👌🏾
Ай бұрын
Great video 👍 thanks Is it possible to migrate while using CloudKit?
@tundsdev
Ай бұрын
Yh you should be able too, you'd just have to enable icloud syncing on your container in your future app release and the schemas you have at that time would then by synced to icloud. You can check out the icloud vid on ym channel too
@w0mblemania
11 ай бұрын
This is very useful, thank you. A question: when it comes to adding a new property like "isArchived" and "isFlagged", wouldn't automatic migration automatically set such values to false, rather than nil? Cheers.
@tundsdev
11 ай бұрын
Thanks & it depends on the type. If it was optional then yh it can be nil. But its non optional you have to add a default value. So it would be whatever you set it can’t assign a value to non optional automatically
@w0mblemania
11 ай бұрын
@@tundsdev Cheers.
@joe-su3
3 ай бұрын
@@tundsdev Since there is already a default value, why do we still need to set the value in the database in didMigrate? If null values are an issue, the line context.fetch(FetchDescriptor()) would have already caused a crash.
@tiIIus
11 ай бұрын
Thank you, very helpful! Could you make a video on how to implement a fully working subscription just with StoreKit 2 and the new SwiftUI SubscriptionStoreView?
@tundsdev
11 ай бұрын
It’s already in the works 👀, I really appreciate the support and don’t forget to subscribe & share the channel 🙏🏾
@chris_bennett
11 ай бұрын
Great video, as always🔥! One question about ToDosSchemaV3: do we need to keep the @Attribute(originalName: "timestamp")? Renaming was already taken care of in V2…
@tundsdev
11 ай бұрын
Thanks & probably not since it’s already been renamed in V2 like you say 👌🏾, that’s what I get for copying and pasting code 😂
@tundsdev
11 ай бұрын
So this isn't actually the case you do need this Attribute, I just tested this out in a different scenario and the app crashed for me when i added another migration plan so i'd leave this in place
@chris_bennett
11 ай бұрын
@@tundsdev thanks so much for your additional testing and follow up 💯
Пікірлер: 45