Ethan
Ethan

Reputation: 11

How to prevent Trailing Swipe Actions from overlapping on my cell?

I have Trailing Swipe actions set up for my table view. And everything works fine, until I delete a cell, and then the cell below it has its trailing swipe actions overlapping with its cell when it's swiped over, rather than swiping over the actual cell to present the trailing swipe actions. Some notes that I've discovered: - Only the cell directly below a deleted one is affected. - The cell is only affected for a little bit of time, or until the user scrolls the table view up and down. But it's still a big issue in actual use given that typically people will delete their cells in rapid succession.

I've taken a screen recording an put it on Youtube:

https://www.youtube.com/watch?v=a_8JuLFrfyE&feature=youtu.be

I have tried controlling when the table view enters and exits its updating via .beingUpdates and .endUpdates, but that made no difference. And I tried reloading the problematic cell, but that didn't help and made the cell flash. I also tried scrolling the table view just slightly after a deletion, but that didn't help either.

func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? { // The configuration of the cells isn't very important, but it's more so an issue just when deleting cells that have trailing swipe actions. }

Upvotes: 1

Views: 300

Answers (0)

Related Questions