title: Auto Layout questions for UILabel sizing (project attached)
body: <p>I'm a bit stumped regarding a few things I am trying to setup using Auto Layout.</p>
  
  <p>Here's what I currently have. As you can see, I am trying to implement something similar to the Messages.app. I made the test/demo project very similar to explain it a bit easier.</p>
  
  <p>Here's the project: <a href="https://github.com/runmad/MessagingApp" rel="nofollow noreferrer">https://github.com/runmad/MessagingApp</a></p>
  
  <p><img src="https://i.stack.imgur.com/454zN.png" alt="enter image description here"></p>
  
  <p>I am trying to achieve a few things:</p>
  
  <p><strong>• Use Auto Layout for self-sizing cells:</strong>
  I have set this up no problem, since it pretty much comes for free.</p>
  
  <p><strong>• Add inset between the label's frame and its text:</strong> I was under this was possible using <code>layoutMargins</code> (<a href="http://carpeaqua.com/2014/07/24/auto-layout-in-ios-8-layout-margins/" rel="nofollow noreferrer">http://carpeaqua.com/2014/07/24/auto-layout-in-ios-8-layout-margins/</a>) but I have no been able to do this.</p>
  
  <p><strong>• Size the label to the text OR a 60% maximum width of the <code>contentView</code></strong>: I have been able to do this for the grey messages above (except maybe not for the first grey one?), but I have not been able to correct size the blue ("sent") messages to be a maximum of 60% of the width of the cell's <code>contentView</code>.</p>
  
  <p>I am targeting iOS 8.0, so for <code>layoutMargins</code>, this should be OK. I am also using Storyboard and Auto Layout within IB.</p>
  
  <p>Any help and insight much appreciated!</p>