TOInsetGroupedTableView
TOInsetGroupedTableView copied to clipboard
Create a more elegant look for "swipe-to-delete"
While passable, the visual look if the user swipes on a cell and the delete button appears looks quite messy.
On iOS 13, the delete button is also wrapped inside the clipping bounds of the rounding mask, but replicating this look in iOS 12 might require more UIView hacking than is actually worth it.
I'm making a note of this now, and when I actually get to a point in my production code when I need it, I'll revisit it.
Jotting this down so I don't forget.
- When a cell is swiped, a
UISwipeActionPullViewis spawned next to it. - The cell in question is briefly removed, and re-added as a subview in the table view.
- Both of these events can be captured in the table view
didAddSubview:override. - When the animation is completed/canceled, the swipe view will also be tagged in
willRemoveSubview:.
Knowing these, it should be possible to intercept both the start and stop events, and encapsulate the cell and the swipe view in clipping view for the duration.