title: Calculating number of lines of dynamic UILabel (iOS7)
body: <p>There are many solutions to this questions arround but couldn't find <strong>non-deprecated</strong> one.</p>
  
  <p>I have an <code>UILabel</code> with mode WordWrap and fixed width of, let's say 250. Lines are set to 0.</p>
  
  <p>Here is what I tried:</p>
  
  <pre><code>UILabel *contentLabel = (UILabel*)[contentView viewWithTag:10];
  CGSize size = [contentLabel.text sizeWithFont:contentLabel.font forWidth:contentLabel.frame.size.width lineBreakMode:NSLineBreakByWordWrapping];
  NSLog(@"Label's height is: %d", size.height);
  </code></pre>
  
  <p>The output of height param is always 20 (so it's like one line), while te text is like 30 lines long.</p>
  
  <p>I need that for UIScrollView purposes.</p>