I have UITextViews in UITableViewCells. What I want to do is make the cell fit the textView If the cell contains a textView. I can make a if statement for every cell and return the textView's size, (I have more than 1 cell with a textView) as I started in the code below, but I'm sure there is another way of doing this.
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 1 && indexPath.row == 0) {
return myTextview.frame.size.height + 40;
}
return 44;
}
I'm a beginner, so please don't be too harsh.