title: Make font grow together with UILabel (resized by Auto Layout) - how to do it in Interface Builder?
body: <p>In <a href="https://github.com/afarber/ios-newbie/tree/master/Tile">a simple iPhone app</a> I display a letter tile (custom <code>UIView</code> with an image and 2 labels) by the following code in <a href="https://github.com/afarber/ios-newbie/blob/master/Tile/Tile/ViewController.m">viewDidLoad</a>:</p>
  
  <p><img src="https://i.stack.imgur.com/wJRAo.png" alt="app screenshot"></p>
  
  <pre><code>DraggedTile *tile = [[[NSBundle mainBundle] loadNibNamed:@"DraggedTile"
                                                     owner:self
                                                   options:nil] firstObject];
  tile.frame = CGRectMake(10 + arc4random_uniform(100),
                          10 + arc4random_uniform(100),
                          kWidth,
                          kHeight);
  [self.view addSubview:tile];
  </code></pre>
  
  <p>This works okay, but I would like to make the letter tile grow - when I supply bigger width and height parameters to the <code>CGRectMake</code>.</p>
  
  <p>So in Xcode 5.1 Interface Builder  I open the <code>DraggedTile.xib</code> and enable "Auto Layout".</p>
  
  <p>Then for the <code>image</code> and <code>letter</code> I add constraints to the left, top, right, bottom edges of the parent.</p>
  
  <p>For the <code>letter</code> label I also set "Lines" to 0 and "Content Compression Resistance Priority" to 1000 (here <a href="https://i.stack.imgur.com/H1iUn.png">fullscreen 1</a> and <a href="https://i.stack.imgur.com/WwshH.png">fullscreen 2</a>):</p>
  
  <p><img src="https://i.stack.imgur.com/H1iUn.png" alt="Xcode screenshot"></p>
  
  <p><img src="https://i.stack.imgur.com/WwshH.png" alt="Xcode screenshot"></p>
  
  <p>Then I modify the code to use bigger width and height:</p>
  
  <pre><code>tile.frame = CGRectMake(10 + arc4random_uniform(100),
                          10 + arc4random_uniform(100),
                          2 * kWidth,
                          2 * kHeight);
  </code></pre>
  
  <p>Here is the result:</p>
  
  <p><img src="https://i.stack.imgur.com/nnise.png" alt="app screenshot"></p>
  
  <p>Both the background <code>image</code> and the <code>letter</code> label seem to have grown as intended.</p>
  
  <p>However the font size of the label hasn't grown.</p>
  
  <p>I've searched around and I think that I need something like <code>tile.letter.adjustsFontSizeToFitWidth = YES</code>. But at the same time I can not use it with "Auto Layout" being on...</p>
  
  <p><strong>So my question is</strong> if there is any option in the "Interface Builder" available to make the font size grow as well?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I've tried ismailgulek's suggestion to set the font size to 200 in Interface Builder and <a href="https://github.com/afarber/ios-newbie/blob/master/Tile/Tile/ViewController.m">in the code</a> <code>tile.letter.adjustsFontSizeToFitWidth = YES</code> and it looks promising (here <a href="https://i.stack.imgur.com/Wtb3o.png">fullscreen</a>):</p>
  
  <p><img src="https://i.stack.imgur.com/Wtb3o.png" alt="Xcode screenshot"></p>
  
  <p>but I have now the problem that I have set 40px as the <code>letter.bottom</code> constraint in Interface Builder. But what if I need a bigger tile frame? Is there a way to use percentage instead of absolute pixel value in that constraint?</p>
  
  <p><strong>And another question</strong> is if it's possible to set the <code>adjustsFontSizeToFitWidth</code> somewhere in the Interface Builder or do I have to use source code for that? I've tried adding a key to the "User Defined Runtime Attributes" - but then the app crashes at the runtime:</p>
  
  <p><img src="https://i.stack.imgur.com/JJIjI.png" alt="Xcode screenshot"></p>