How do I create a custom edit row feature in table view?

I would like to create behavior in my table view that allows the user to swipe left on a row and along with the delete view to tap on another view also appears for the user to tap on that takes him to a detail view of the row. This is the same behavior for example as the Reminders app – when the user swipes left there is a delete area to tap on and a “more” area to tap on that takes the user to a detail view of the row. How would I get table view to show that extra view? How would I do that?

Hi @brower

There a lot of helpful tutorials/approaches on this topics. Please take a look at this answer - https://stackoverflow.com/a/29166246/2984553, it uses the tableView(_:editActionsForRowAt:) method of the UITableViewDelegate.
Hope this is helpful.

Nikita

I got it to work, except when I tap on the action to segue to a different view controller the actions don’t disappear. How do I dismiss the actions so that they disappear? When I tap the delete action the actions do disappear.

Hi @brower

It depends on how you show those actions. Are you using some 3d party library for this? Or you subclassed the UITableViewCell and implemented it yourself?

I’m not using third-party software, but I did subclass UITableViewCell. In any case, I solved the problem by called reloadRows on the row showing the actions.

This topic was automatically closed after 166 days. New replies are no longer allowed.