No cap one of THE best tutorials on swiftdata migration/versioning
@andrejkling38869 ай бұрын
Best series on Tube...💯🔥 thanks a lot Tuns 🥇
@mullassery8 ай бұрын
Excellent video. No fluff; all value 👌
@tundsdev8 ай бұрын
Glad you enjoyed it!
@Kontrbandist6 ай бұрын
Hey mate, thanks for the tutorial, finally got a better understanding about Migration which been struggling. Cheers!
@tundsdev6 ай бұрын
Glad it helped!
@robertj16794 ай бұрын
DUDE! Thank you SO much for this video so many other tutorials do not address handling multiple models!
@tundsdev4 ай бұрын
Glad it helped!
@dmacharo7 ай бұрын
Man this is absolute gold! Thanks heaps!
@tundsdev7 ай бұрын
Glad you enjoy it 👌🏾
@dmacharo7 ай бұрын
@@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!
@tundsdev7 ай бұрын
@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!
@maryannadelman44386 ай бұрын
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.
@tundsdev6 ай бұрын
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 👌🏾
@lib989210 ай бұрын
Thank you so much for all you done, it's very helpful for me! Liked, subscribed and commented!
@avgeekguy11 ай бұрын
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!
@tundsdev11 ай бұрын
Cool idea for sure 👌🏾
@Jake-b4s3 ай бұрын
Very detailed tutorial 👍
@user-zl6qv9vn1z6 ай бұрын
Subject suggestion: Transferring SwiftData model from watch to phone. I could definitely use a tutorial on that one!
@tundsdev6 ай бұрын
Can you explain this one a bit more?
@bscheirman Жыл бұрын
You had me at 2Pac and lost me at McDonald’s 😂
@tundsdev Жыл бұрын
McDonalds is easily the creme de la crem of fast food 🤷🏾♂️
@tiIIus11 ай бұрын
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?
@tundsdev11 ай бұрын
It’s already in the works 👀, I really appreciate the support and don’t forget to subscribe & share the channel 🙏🏾
@Artifismo7 ай бұрын
My Application Support is Empty after adding some records.
@aprilzoo9561 Жыл бұрын
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 Жыл бұрын
I’ve not actually, but do you mean like a code review? It’s something i could do & consider for sure 👌🏾
@aprilzoo9561 Жыл бұрын
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 Жыл бұрын
Cool for sure i’ll look into it, great suggestion 👌🏾
@federicoramos2 ай бұрын
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?
Ай бұрын
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 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
@@tundsdev Cheers.
@joe-su33 ай бұрын
@@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.
@chris_bennett Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
@@tundsdev thanks so much for your additional testing and follow up 💯
@mikehimself909 Жыл бұрын
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 Жыл бұрын
👋🏾 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 👌🏾