title: iOS 8: UITableViewCell detail text not correctly updating
body: <h3>tl;dr: Can I cause the detailTextLabel to have its size updated by the auto layout system in iOS on a value change?</h3>
  <p>Has anyone else had issues with the detailText label within an UITableViewCell since iOS 8?</p>
  <p>I have a table which both text and detail strings.   Initially detail text is an empty string (@&quot;&quot;).  After performing a storyboard segue to an edit screen, I return with a new value for the detail text and update it.  I attempt to reload the table in viewWillAppear so that the value is present immediately upon returning to the previous view.</p>
  <p>Once the table view is visible again, the table cell has shifted the text field up to make room for the detail text, but no detail text is displayed.  The text does not display until I return to the edit screen, and come back a second time.</p>
  <p><strong>What I've done to troubleshoot:</strong> It looks as thought the auto layout for the detail text label isn't correctly updating as I think it should, and logging the size and makeup of the detailTextLabel's frame confirms this.</p>
  <p>I am able to force the text to update by running [table reloadData] within viewDidAppear, however that leaves me with a flicker effect I don't like, and looks unprofessional.</p>
  <p>Edit: Additional things I've done: I've also forced the detailTextLabel to re-size itself using [cell.detailTextLabel sizeToFit].  This causes it to display, but offset in an odd way in the cell.  After going to the edit page again, the detailTextLabel fixes it's position.</p>
  <p>I've created a simple project as a github repo, to show exactly what I'm dealing with:</p>
  <p><a href="https://github.com/acidaris/ios8_table_issue" rel="noreferrer">https://github.com/acidaris/ios8_table_issue</a></p>
  <p>The main code of the view controller I'm using is also below.</p>
  <pre><code>- (void)viewWillAppear:(BOOL)animated {
      [super viewWillAppear:animated];
      [self.table reloadData]; 
  }
  
  
  - (NSInteger)tableView:(UITableView *)tableView
      numberOfRowsInSection:(NSInteger)section {
      return 1; 
  }
  
  - (UITableViewCell *)tableView:(UITableView *)tableView
  cellForRowAtIndexPath:(NSIndexPath *)indexPath {  
      UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@&quot;CellIdentifier&quot;];
      
      cell.textLabel.text = @&quot;This is a test&quot;;
      cell.detailTextLabel.text = self.value;
      
      CGRect frame = cell.detailTextLabel.frame;
      NSLog(@&quot;detailTextLabel x=%f y=%f width=%f height=%f&quot;,
          frame.origin.x,frame.origin.y,frame.size.width,frame.size.height);
      return cell; 
  }
  </code></pre>
  <p>The cell is prototyped within a StoryBoard, and so the cell selected by dequeueReusableCellWithIdentifier: is always defined.  Additionally, the cell type within the storyboard is set to subtitle, and it does display if the initial value is defined.</p>
  <p>If anyone could help me figure this out, I would be incredibly grateful.</p>
  <h2>Partial Solution</h2>
  <p>If you are sub-classing UITableViewCell, you can modify the frame for the detailTextLabel when the layout is done.  This is what I've done, and it seems to have worked, <s>but on the 6 plus, I get a weird dividing line between the textLabel and the detailTextLabel.</s> edit: (I have adjusted for this.)  I don't like this solution, but thus far it's the best I've come across.  It doesn't update after presenting the view, and is relatively simple.  As I said above, I will continue to look for a better solution.</p>
  <pre><code>- (void)layoutSubviews {
    [super layoutSubviews]; 
    CGRect textFrame = self.textLabel.frame;
    [self.detailTextLabel sizeToFit];
  
    CGFloat x = textFrame.origin.x;
    CGFloat y = textFrame.origin.y + textFrame.size.height;
  
    CGSize detailSize = self.detailTextLabel.frame.size;
    CGRect newFrame = CGRectMake(x, y, detailSize.width, detailSize.height);
  
    self.detailTextLabel.frame = newFrame;
  }
  </code></pre>
  <p>I've also updated my Github project to reflect my current solution.  Edit3: This doesn't work perfectly, as it has wrong values for truly auto layout frames, but it works for my uses for the moment.</p>
  <p>Edit 4: I've updated my layoutSubviews function to be smarter.  It will size to fix the content within the label, and position the label appropriately within the x/y coordinates in relation to the text label.</p>