I have an already completed screen in which I have added a listing using UITableView which is inside a UIViewController. Now, I have to add swipe to delete functionality. I see several swipe to delete implementations but all of them assume that UITableViewController is used. Is there a way I can get same functionality in my UITableView which is inside a UIViewController?
I have tried but I can’t achive that goal.
2
Answers
You can do it inside UIViewController as well. You have to implement below 2 functions inside your UIViewController:
I had a problem where my cells were not adjacent to the screen edges and there was some spacing so the default implementation would not look good.
So if you want to add swipe to delete functionality you can very easily add your own custom swipe to delete functionality by:
Here is the my cell class with basic implementation: