title: Custom UITableViewCells in iOS 8 and layoutMargin
body: <p>I have several custom UITableViewCells in my app, mostly defined by nibs.  When moving to iOS 8 and Xcode 6 the margins on the left and right are incorrect.  These cells are often interspersed in a table view with default cells.</p>
  
  <p>I made a sample project, here is the margin issue I'm talking about:
  <img src="https://i.stack.imgur.com/r7ceY.png" alt="margin issue"></p>
  
  <p>The only thing I've been able to find that relates to this is the new property <code>layoutMargins</code>.  For UITableViewCells its value seems to change depending on the device the app is running on:</p>
  
  <pre><code>iPhone 6 and below - layoutMargin: {8, 16, 8, 16}
  iPhone 6 Plus - layoutMargin: {8, 20, 8, 20}
  </code></pre>
  
  <p>This seems to line up with the margins I'm seeing on the standard cells.  However, the content for my custom cells is inside the cells <code>contentView</code>, which has the standard UIView <code>layoutMargin</code> of <code>{8, 8, 8, 8}</code>.  This means any auto layout constraints that are bound to the Container Margin are adding the incorrect spacing.</p>
  
  <p>The only way I've found to fix this is by adding the following in <code>cellForRowAtIndexPath:</code></p>
  
  <pre><code>cell.contentView.layoutMargins = cell.layoutMargins;
  </code></pre>
  
  <p>This doesn't seem like a very good solution going forward (especially since I'd need to wrap it in checks for iOS8 to maintain compatibility).</p>
  
  <p>Does anyone have any ideas? I feel like I must be missing something.</p>