Reputation: 1020
I want to implement a tree structure in a UITableView
something like
Item-1
subItem-1
subItem-2
Item-2
Item-3
subItem-1
subItem-2
but I don't want to use custom cells for this.
I have done lot of Googling
for this but I got one link which said I would have to use custom cells.
If anyone has any ideas please can you shared them with me.
Thanks in advance.
Upvotes: 0
Views: 1031
Reputation: 52565
A table view isn't really designed to display hierarchical views. What's supposed to happen is that you drill down (push a new view controller on the stack) to get to the next level of the hierarchy.
However, if your hierarchy is only as deep as you suggest, then you could have your items as headers and subitems as rows. If you don't want to create a custom view (why not?) you'd be limited to just text for your top level items.
Upvotes: 1