title: iOS Swift Label Frame Height Not Updating Correctly
body: <p>I have a Label whose text changes each time the user clicks a Button.  However, the <strong>Label.frame.height value does not update immediately</strong> even though the Label content has changed.  The function to change the Label is called in multiple places, yet the height ONLY updates just inside the @IBAction block, and its value lags one click cycle.  My code is as follows:</p>
  
  <pre><code>func changeLabelText() {
  //Here I have an algorithm (not shown) that generates myMutableString 
  Label.attributedText = myMutableString  //Label is updated.
  }
  
  
  @IBAction func changeLabelButton(sender: UIButton) {
  print("1. Height = ", Label.frame.height) //Height updates here, but it's the old value.  
  changeLabelText()  //Label is updated.
  print("2. Height = ", Label.frame.height) //Returns same height as Line 1!!
  }
  
  
  override func viewDidLoad() {
  super.viewDidLoad()
  print("3. Height = ", Label.frame.height) //Initially, height is 21.0 when ViewController first loads.
  changeLabelText() //Label is updated.
  print("4. Height = ", Label.frame.height) //Returns height = 21.0, even though simulator shows Label updated!!
  }
  </code></pre>
  
  <p>In summary, this is what's happening:</p>
  
  <ol>
  <li><p>User clicks Button, Label displays new text, but frame.height is unchanged.</p></li>
  <li><p>User clicks Button again, Label text changes again, frame.height updates this time, but updates to the old value it should've had on Step 1.</p></li>
  </ol>
  
  <p>I'm relatively new to Swift, and any help with this is appreciated.</p>