TOInsetGroupedTableView icon indicating copy to clipboard operation
TOInsetGroupedTableView copied to clipboard

Create a more elegant look for "swipe-to-delete"

Open TimOliver opened this issue 5 years ago • 1 comments

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.

TimOliver avatar Apr 11 '20 05:04 TimOliver

Jotting this down so I don't forget.

  • When a cell is swiped, a UISwipeActionPullView is 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.

TimOliver avatar Apr 11 '20 08:04 TimOliver