title: Resize UILabel based on content
body: <p>I have a UILabel, his text size has the property</p>
  
  <pre><code>title.adjustsFontSizeToFitWidth = YES;
  </code></pre>
  
  <p>that prevents me from using standard methods to resize the UILabel. I read on another post here that I'm supposed to use the function</p>
  
  <pre><code>sizeWithFont:minFontSize:actualFontSize:forWidth:lineBreakMode
  </code></pre>
  
  <p>from this answer: <a href="https://stackoverflow.com/questions/2396715/how-to-figure-out-the-font-size-of-an-uilabel-when-adjustsfontsizetofitwidth-is">How to figure out the font size of a UILabel when -adjustsFontSizeToFitWidth is set to YES?</a></p>
  
  <p>Now, i can't figure out how to make it work.. this is the actual code</p>
  
  <pre><code>UIFont *font = [UIFont fontWithName:@"Marker Felt" size:200];
  UILabel *title = [[UILabel alloc] initWithFrame:CGRectMake(0.0, 0.0, width, 20.0)];
  title.text = @"this is a long title that should be resized";
  title.font = font;
  title.numberOfLines = 1;
  title.adjustsFontSizeToFitWidth = YES;
  
  CGFloat pointSize = 0.0;
  CGSize size = [title.text sizeWithFont:font 
                             minFontSize:title.minimumFontSize 
                          actualFontSize:&amp;pointSize 
                                forWidth:width 
                           lineBreakMode:title.lineBreakMode];
  title.frame = CGRectMake(title.frame.origin.x, 
                           title.frame.origin.y, 
                           size.width, 
                           size.height);
  </code></pre>
  
  <p>The UILabel get resized wrongly, as if the font size it's still 200..
  Any clues? Thanks!</p>