I asked people on social media why my todo list is not handling animations correctly: / 1547624505148747777
The approach was by using indices instead of a collection of identifiable elements, this is because we have to mutate the todos inside the list directly (Which is not possible by default).
In this video, I will explain in detail the root cause and how you can solve this to fix your animations and mutate your state inside a List!
------
Demo showed in the video:
https://gist.github.com/pitt500/2691f...
------
Resources:
https://www.swiftbysundell.com/articl...
------
Videos related:
NavigationStack (iOS 16): • NavigationStack | This is how SwiftUI...
State and Binding: • SwiftUI's lifecycle, @State and @Bind...
any Keyword: • "any" Keyword and Existential types i...
The Anatomy of a KeyPath: • The Anatomy of a Key Path
-----
Contact:
/ swiftandtips
/ swiftandtips
/ swiftandtips
Finally, ask me for a video you would like to see next 😄!
Credits:
Music by Wataboi from https://pixabay.com/
Video edited with Final Cut Pro
Смотрите видео Why animations in this SwiftUI's List stopped working? онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Swift and Tips 29 Июль 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 3,083 раз и оно понравилось 63 людям.