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
@phill I still find the animation to be wrong when I use a confirmationDialog for the destructive action in the swipeAction. When I do that in SwiftUI, it seems to different that what we can find in Messages app for example when deleting a conversation.
Have you encountered this too?
@alpennec AFAIK there is no equivalent of UIContextualAction's handler in SwiftUI. Messages is likely using that to defer the editing commit until the user has confirmed. Since there is no callback on swipeAction I'm not sure how it would be possible.
@phill oh I’ve never thought about that! Thanks for the tip. I will loose the accessibility stuff but the visual aspect feels better.