title: How to center horizontally two labels?
body: <p>I have pretty straightforward requirements where two labels must be centered horizontally. So, I have selected them and chose Editor->align->center horizontally. Then added top space to container constraint to both of them. I also need the labels to shrink/grow regarding content size. However, IB shows errors and several warnings. I could make the labels shrink/grow just by adding pin between them (horizontal space) but they will not be centered in that case. Here are the screenshots:</p>
  
  <p><img src="https://i.stack.imgur.com/4diNx.png" alt="enter image description here"></p>
  
  <p>here are the errors and warnings:</p>
  
  <p><img src="https://i.stack.imgur.com/dvqfA.png" alt="enter image description here"></p>
  
  <p><strong>UPDATE</strong> theraven gave an interesting suggestion to use dummy view for centering it horizontally and pinning two labels to it. I have removed all existing constraints, added this dummy view and center X + center Y constraints to it. Then pined two labels to it (added horizontal space constraints). However, I still get a bunch of errors and warnings:</p>
  
  <p><img src="https://i.stack.imgur.com/2neXU.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/22QOH.png" alt="enter image description here"></p>
  
  <p><strong>UPDATE2</strong> Just updating the question, but still no valid answer found. @Theraven workaround works for iPhone4, iPhone4S, iPhone5 and iPhone5S, however it's not real centering but rather a  workaround. Therefore for iPhone6 and iPhone6 Plus it doesn't work as leading and trailing spaces will be fixed and won't automatically resize for larger width.</p>