title: Dynamically manage TableViewCell Height by clicking UIButton
body: <p>I'm practicing with <code>TableViewController</code> and custom <code>TableViewCell</code>. I have made a question list &amp; after clicking <strong>Show</strong> button it shows the question's options like this.</p>
  
  <p><a href="https://i.stack.imgur.com/PJxul.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PJxul.png" alt="enter image description here"></a></p>
  
  <p>but removing spacing of question list view from above image I have wrote this code</p>
  
  <pre><code>-(void)viewWillAppear:(BOOL)animated{
      self.tableView.estimatedRowHeight = 40.0;
      self.tableView.rowHeight = UITableViewAutomaticDimension;}
  </code></pre>
  
  <p>and the output comes like this before and after clicking <strong>Show</strong> button.</p>
  
  <p><a href="https://i.stack.imgur.com/FLe3y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FLe3y.png" alt="enter image description here"></a></p>
  
  <p>but I'm trying to make my output with dynamically manageable the row height after clicking the <strong>Show</strong> button.</p>
  
  <p><strong>Constraints :</strong></p>
  
  <p><a href="https://i.stack.imgur.com/SkKYa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SkKYa.png" alt="enter image description here"></a></p>
  
  <p><strong>NOTE: I have gone through</strong> <a href="https://stackoverflow.com/questions/18746929/using-auto-layout-in-uitableview-for-dynamic-cell-layouts-variable-row-heights">Using Auto Layout in UITableView for dynamic cell layouts &amp; variable row heights</a></p>
  
  <p>But haven't resolved my problem.</p>
  
  <p>Thanks.</p>