I’m trying to come up with a nice (in terms of coding & apperance) way of deleting a section from a table view. Ideally I would like to create a way of deleting sections that is similar to that of the process for deleting a UITableViewCell (ie. the red minus button that shows the red delete button when pressed).
Is there any pre-existing solution to this problem? I have tried doing a bit of research into the are but I can’t really find anything of much use. If there isn’t a pre-existing solution I was thinking I could try and implement one. My plan would be to create a custom header for each section. Within the custom header I’d add the delete buttons that would react the same way as when deleting a row. Do people think this would work?
So to be clear, I’m asking whether there is an existing solution for deleting sections in a UITableView. If there isn’t then I’d like to know if people think my idea would be feasible or if there are any issues I’ve overlooked with it.
Thanks in advance.
Implementing your own headerView is the way to go. Apple does not provide a built-in user interface to delete sections. If you pull down the notification area of an iOS device you get an idea how to make it look good.
The implementation is not very complicated either. I used something like this: