title: Wordwrap vs. Newline UIButton stretching
body: <p>I have a <code>UIButton</code> and I need to be able to set its label to any text, and therefore it needs to stretch vertically.</p>
  
  <p>When setting the text with <code>\n</code> characters the UIButton expands correctly:</p>
  
  <pre><code>self.myButton.titleLabel.textAlignment = NSTextAlignmentCenter;
  self.myButton.titleLabel.lineBreakMode = NSLineBreakByWordWrapping;
  self.myButton.titleLabel.numberOfLines = 0;
  [self.myButton setTitle:@"Lorem ipsum dolor sit amet, consectetuer \nadipiscing elit, sed diam nonummy nibh \neuismod tincidunt ut laoreet dolore \nmagna aliquam erat volutpat. \nUt wisi enim ad minim veniam, \nquis nostrud exerci tation ullamcorper \nsuscipit lobortis nisl ut aliquip ex \nea commodo consequat." forState:UIControlStateNormal];
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/UL5TM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UL5TM.png" alt="enter image description here"></a></p>
  
  <p>But when I don't have any <code>\n</code> and instead let the label line-break itself based on the content, the lines don't seem to matter to the <code>UIButton</code> height</p>
  
  <pre><code>self.myButton.titleLabel.textAlignment = NSTextAlignmentCenter;
  self.myButton.titleLabel.lineBreakMode = NSLineBreakByWordWrapping;
  self.myButton.titleLabel.numberOfLines = 0;
  [self.myButton setTitle:@"Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat." forState:UIControlStateNormal];
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/GqCMe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GqCMe.png" alt="enter image description here"></a></p>
  
  <p>Is there a configuration on <code>UIButton</code> or its <code>UILabel</code> that controls this behavior or is this an iOS bug? (Running on iOS 9.1)</p>
  
  <p><strong><em>NOTE:</strong> I'm not really interested in manually re-calculating the frame size of the UIButton each time the text is changed, I'm wondering if there's an autolayout constraint or config property on UIButton to get the right behavior</em></p>