I am trying to accomplish the following 3 requirements:
- Display a
UITableViewthat has sections of content. - Be able to rearrange the rows of the table between sections.
- Be able to rearrange the sections, similar to how rearranging rows works.
(Also, I cannot use a UICollectionView)
I can currently do the first two without any problem. I’ve done iOS development for a while now, but I’m stumped on how to actually rearrange the sections, and make it appear as it would be if you were moving a row.
I’ve tried to make a nested table in a UITableViewCell, and pretend the first cell is a “header,” but this only works for moving sections and breaks the ability to rearrange rows between sections (admittedly, I could be going about this wrong).
I realize this is a complex question, but any help would be appreciated – even if the answer is “can’t be done.”
I think that the only way to achieve a completely free row and section reordering is to build a fully custom UIView subclass that looks like a UITableView (or not, if you want) and go hard on gesture recognizers for repositioning. It won’t be fast, but it’s completely possible.
Aside from the problem of creating this rather complex table thing, perhaps there is another way to solve your current problem, one that is less troublesome.