0

I am developing an app that initially displays a table. You tap a cell in the table and the cell expands, showing a table view inside the cell. To do this I implemented the UITableView delegate inside the custom UITableViewCell. I would like to now have a selection on a cell in the second table view to expand the cell and show another table (two levels drop). Is this possible? Would I just create a table on selection (didSelectRowAtIndexPath in the custom cell class)? Where would I put the table methods for it?

enter image description here

Qantas 94 Heavy
  • 15,750
  • 31
  • 68
  • 83
Dale Townsend
  • 671
  • 3
  • 13
  • 25

1 Answers1

3

Important: You should not embed UIWebView or UITableView objects in UIScrollView objects. If you do so, unexpected behavior can result because touch events for the two objects can be mixed up and wrongly handled. source

As UITableViews subclasses UIScrollViews this applies here too.

What you want can be achieved by using section header views for the coffee displaying view and custom cells for the options.
Or using custom cells for he coffee views and section footer views for the options.

Community
  • 1
  • 1
vikingosegundo
  • 52,040
  • 14
  • 137
  • 178
  • So at first just the section header will be visible, and tapping the section header will expand it, showing the custom cells containing the options? Is there a way to detect a tap on a section header and show the cells of that section? – Dale Townsend Jan 03 '15 at 00:58
  • If you disable scrolling for the embedded view, I believe you do not fall afoul of that warning, correct me if I am wrong. – AmitaiB Feb 07 '19 at 01:47
  • @AmitaiB You will have to direct that question to apple. I would not expect a response. – vikingosegundo Feb 07 '19 at 13:01