There are over a dozen questions about SO that are similar, but there seems to be no consensus on the best way to do this. Also, I did not find a solution that worked for me. What is different from my custom UITableViewCell is that I have two labels, one of which is in its own view and a text view. All three of them should expand to their contents.
I am wondering if my restrictions are configured incorrectly, but I'm not sure what to configure.
Here is my cell in IB.

The content view is light red; the optional top view is white with a label inside it.
When changing the text, I save the text and update tableView:
-(void)textViewDidChange:(UITextView *)textView
{
NSLog(@"row: %i", textView.tag);
[self.textStrings setObject:textView.text atIndexedSubscript:textView.tag];
[self.tableView beginUpdates];
[self.tableView endUpdates];
}
tableView:heightForRowAtIndexPath: , . , systemLayoutSizeFittingSize:. , -, .
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if ([self.selectedRow integerValue] != indexPath.row && indexPath.row < [self.rowHeights count]){
return [[self.rowHeights objectAtIndex:indexPath.row] floatValue];
}
static NSString *CellIdentifier = @"RMTextViewCell";
RMTextViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
[self configureCell:cell forIndexPath:indexPath];
[cell layoutIfNeeded];
CGFloat height = [cell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height;
height += 1;
NSNumber *h = @(height);
[self.rowHeights setObject:h atIndexedSubscript:indexPath.row];
return height;
}
TextView , , . / textView . , , .
?
Github . ViewControllers/RMTextViewTableViewController Cell/RMTextViewCell. , " ".