title: UITableView inside UITableViewCell with dynamic cell height
body: <p>I have a dynamic list of items, each item could have different teamplate/layout (and height). And one those item types could have an internal list of items to select from, regularly 5-6 rows, each has different height.</p>
  
  <p>If I try to describe it further, in my scenario I have one tableview (#slave) inside tableviewcells (#master-cell) of another tableview (#master). Moreover cells (#slave-cell) in my #slave tableview could have different height as well. So I need to layout my #slave to have #master automatically calc and update its size.</p>
  
  <p><a href="https://i.stack.imgur.com/COyYV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/COyYV.png" alt="enter image description here"></a></p>
  
  <p>I have the issue with the inner table (#slave). In case of auto-layout, to fit all the cell space, the table will be collapsed unlike UILabel or other controls. So what I need here is to get the projected size of #slave table and set the height of the #slave = content height of the #slave.</p>
  
  <p>I found <a href="https://stackoverflow.com/questions/3231525/calculate-the-tables-contentsize-height-with-custom-cells-of-different-types-ip">similar post</a> and it works if all rows have the same height but I'm using custom rows with dynamic height so the tableView.contentSize.Height gives me invalid result (basically just  multiply rowNumbers * estimatedRowHeight, you can see it on the screenshot, master item #3 has 4 inner cells). Even after calling #slave.reloadData I couldn't get that size.</p>
  
  <p>What is the proper way to build that kind of UI? </p>
  
  <p><a href="https://www.dropbox.com/s/z5b3si7bnw2zfhu/tableInsideTable.zip?dl=0" rel="nofollow noreferrer">Source code</a> with a test project attached (Xamarin.iOS)</p>