title: Resize UITableViewCell containing UITextView upon typing
body: <p>I have an UITableViewController that contains a custom cell. Each cell was created using a nib and contains a single non-scrollable UITextView. I have added constraints inside each cell so that the cell adapts its height to the content of the UITextView. So initially my controller looks like this :</p>
  
  <p><a href="https://i.stack.imgur.com/61R0Mm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/61R0Mm.png" alt="initial state"></a></p>
  
  <p>Now I want that when the user types something in a cell its content automatically adapts. This question has been asked many times, see in particular <a href="https://stackoverflow.com/questions/460014/can-you-animate-a-height-change-on-a-uitableviewcell-when-selected/2063776#2063776">this</a> or <a href="https://stackoverflow.com/questions/6573752/resizing-uitableview-cell-by-uitextview-contents-size">the second answer here</a>. I have thus written the following delegate in my code : </p>
  
  <pre><code>- (BOOL) textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString*)text {
      [self.tableView beginUpdates];
      [self.tableView endUpdates];
      return YES;
  }
  </code></pre>
  
  <p>However it leads to the following strange behavior : all constraints are ignored and all cells height collapse to the minimal value. See the picture below:</p>
  
  <p><a href="https://i.stack.imgur.com/jfnQJm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/jfnQJm.png" alt="wrong behavior"></a></p>
  
  <p>If I scroll down and up the tableView in order to force for a new call of cellForRowAtIndexPath, I recover the correct heights for the cells:</p>
  
  <p><a href="https://i.stack.imgur.com/jw4pVm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/jw4pVm.png" alt="correct behavior"></a></p>
  
  <p>Note that I did <em>not</em> implement heightForRowAtIndexPath as I expect autoLayout to take care of this.</p>
  
  <p>Could someone tell me what I did wrong or help me out here ? Thank you very much !</p>