SwiftUI: implementing Dynamic List Updates and Animations on iOS 17
I'm working through a tutorial and I'm working with a frustrating scenario with dynamically updating a `List` in SwiftUI on iOS 17... Specifically, when I modify my data source and expect the list to update with animations, it seems to ignore the animation block entirely. I have a simple data model and a view that displays this list: ```swift struct Item: Identifiable { let id = UUID() var name: String } struct ContentView: View { @State private var items: [Item] = [Item(name: "Item 1"), Item(name: "Item 2")] var body: some View { VStack { List(items) { item in Text(item.name) } Button("Add Item") { addItem() } } } private func addItem() { withAnimation { // This does not seem to trigger the animations items.append(Item(name: "Item \(items.count + 1)")) } } } ``` I expected the new item to slide in from the bottom when I press the "Add Item" button, but instead, the items just reload without any animation. I also tried using `.animation(.default)` on the `List`, but that didn't change anything. This behavior is inconsistent with previous versions of iOS. I've also confirmed that `items` is being updated correctly, as I can see the new item being added in the `List`, but the animation aspect is simply not functioning. Has anyone else experienced this scenario, or does anyone have suggestions on how to ensure animations are triggered properly in a dynamic SwiftUI `List`? I appreciate any insights or workarounds that could guide to resolve this question. What's the best practice here? Any examples would be super helpful.