I've been stuck on this for a number of days and if someone has an idea for how this could be done that would be absolutely fantastic.
The goal is to display text like the following in a single UITableView:
Heading 1
- Sub-Heading 1
-- Sub-Sub-Heading 1
-- Sub-Sub-Heading 2
- Sub-Heading 2
Heading 2
- Sub-Heading 1
- Sub-Heading 2
-- Sub-Sub-Heading 1
-- Sub-Sub-Heading 2
-- Sub-Sub-Heading 3
- Sub-Heading 3
Heading 3
- Sub-Heading 1
-- Sub-Sub-Heading 1
-- Sub-Sub-Heading 2
The table view would also allow each heading, sub-heading, etc. to collapse/expand the sub-elements underneath it and lastly also allow reordering of all rows.
I've seen table views that allow you to collapse sections and that also allow reordering, but the reordering is always limited to the rows within the sections and there's only one level of collapsing/expanding. I know it should be possible since this style of data organization is used in applications like Photoshop with its handling of layers, but I'm not sure where to begin (or even if the theoretical solutions I have are good ones).
One idea was to use NSMutableArrays within NSMutableArrays but then with reordering, the thought of managing all of them started to look very complicated. And so I wondered if there's a simpler way. Any ideas?
The goal is to display text like the following in a single UITableView:
Heading 1
- Sub-Heading 1
-- Sub-Sub-Heading 1
-- Sub-Sub-Heading 2
- Sub-Heading 2
Heading 2
- Sub-Heading 1
- Sub-Heading 2
-- Sub-Sub-Heading 1
-- Sub-Sub-Heading 2
-- Sub-Sub-Heading 3
- Sub-Heading 3
Heading 3
- Sub-Heading 1
-- Sub-Sub-Heading 1
-- Sub-Sub-Heading 2
The table view would also allow each heading, sub-heading, etc. to collapse/expand the sub-elements underneath it and lastly also allow reordering of all rows.
I've seen table views that allow you to collapse sections and that also allow reordering, but the reordering is always limited to the rows within the sections and there's only one level of collapsing/expanding. I know it should be possible since this style of data organization is used in applications like Photoshop with its handling of layers, but I'm not sure where to begin (or even if the theoretical solutions I have are good ones).
One idea was to use NSMutableArrays within NSMutableArrays but then with reordering, the thought of managing all of them started to look very complicated. And so I wondered if there's a simpler way. Any ideas?
Last edited: