I recently got downvoted into oblivion for explaining why someone's List animation was glitching, perhaps because the solution is so simple it seems stupid.
On the left is swipeAction with a Button. On the right is the exact same Button, but now the animation is smooth.
The difference? I set the Button's role to destructive. SwiftUI uses the role to infer what animation to use. https://gist.github.com/phillipcaudell/e4ee5057dc33f92ed80b817762726275
This doesn't seem that intuitive at first, but if you think about it, how would SwiftUI anticipate what action will be performed on your model?
In iOS 17 the animation has been improved considerably if you don't explicitly set the role, but for best results you still need to set it.
@phill oh I’ve never thought about that! Thanks for the tip. I will loose the accessibility stuff but the visual aspect feels better.
@phill I see. Currently, the row disappears then reappears when the confirmationDialog is presented... which is ugly but I guess I can’t do better for now 😞