title: Swift - UILabel automatically adjusted to text length
body: <p>As mentioned many times before, neither label.sizeToFit() nor label.numberOfLines=0 work for me. All the time I end up with the same height of label with text ended with "…". </p>
  
  <p>I really want to keep my label width constant with adjustable height, but any solution I found around the forum wasn't working for me. I know it would be better to ask it as a comment to existing question, but unfortunately I'm not able to do that due to my point's account.</p>
  
  <p>Do you know any other ways to achieve adjustable height of UILabel, that actually work?</p>
  
  <p>Here is what I have:</p>
  
  <pre><code>    cell.restaurantName.setTranslatesAutoresizingMaskIntoConstraints(false)
      cell.restaurantName.numberOfLines = 0
      cell.restaurantName.sizeThatFits(CGSizeMake(CGFloat(172.0),    CGFloat(MAXFLOAT)))
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/wWxxl.png" alt="enter image description here">
   then I tried exactly the same as posted below</p>
  
  <pre><code>cell.restaurantName.numberOfLines = 0
  cell.restaurantName.sizeToFit()
  </code></pre>
  
  <p>with constraint to width</p>
  
  <p><img src="https://i.stack.imgur.com/9ZRgB.png" alt="enter image description here"></p>
  
  <p>and again I see text with three dots</p>
  
  <p>Thanks in advance</p>