title: UITextView With "See More" Button if it doesn't fit inside UITableViewCell IOS
body: <p>It sounds so simple but it's not, what I want is to make a UITableViewCell with a UITextView inside. I am using auto layout so when the tableview first loads all cell they will all be in the same maximum static size and when I press the cell the cell expand according to the UITextView's text.
  The hard part is to add a "See More" button in the end of the text view if it doesn't fit the static size.(before the cell was pressed)</p>
  
  <p>I also saved to array if the cell was pressed to know if to expand it or not.
  another tricky part is if the textview is below the static size than use the UITableViewAutomaticDimension so if its 40 points of height I don't want the cell to be 102 point because of a blank space the will be created
  for that I need to know if the textview is below 102 point.
  I thought about implementing heightForRow something like that</p>
  
  <pre><code>-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
      {
          if([self isCellWithIndexNeedsToExpand:[NSNumber numberWithInteger:indexPath.row]])
          {
              return  UITableViewAutomaticDimension;
          }
          else
          {
              int height = [self someFunctionThatGivesTheTextViewHeight];
              if(height&gt;102)
                  return 102;
              else
                 return UITableViewAutomaticDimension;
          }
      }
  </code></pre>