title: Swift 3 UILabel, how to word wrap after changing text
body: <p>I have a UILabel which has been created programmatically and want to set the text property dynamically after its creation. I can word wrap it during init but not subsequently. After the title label text is changed it keeps one line, regardless of whether I set the number of lines to 2 or 0 and word wrap or not. After I change the title I want it to occupy 2 lines and the text is easily long enough for this to happen but it does not.</p>
  
  <pre><code>let titleLabel: UILabel = {
      let label = UILabel()
      label.textAlignment = .center
      label.translatesAutoresizingMaskIntoConstraints = false
      label.backgroundColor = .clear
      label.layer.masksToBounds = true
      label.numberOfLines = 0
      label.lineBreakMode = NSLineBreakMode.byWordWrapping
      label.textColor = .white
      return label
  }()
  
  var titleLabelText: String? {
      didSet {
          titleLabel.text = titleLabelText
          titleLabel.layoutIfNeeded()
      }
  }
  </code></pre>
  
  <p>then later...</p>
  
  <pre><code>override func viewWillAppear(_ animated: Bool) {
      super.viewWillAppear(animated)
  
          titleLabelText = "some string which needs word wrapping"
  
  }
  </code></pre>
  
  <hr>
  
  <pre><code>    titleLabel.heightAnchor.constraint(equalToConstant: 40.0).isActive = true
      titleLabel.widthAnchor.constraint(equalToConstant: screenWidth - 90).isActive = true
  </code></pre>
  
  <hr>
  
  <p>Font size is <code>UIFont(name: "Muli", size: 12)</code>
  Here is how I load my label in <code>viewDidLoad()</code> but the label.text is applied in <code>viewDidAppear()</code></p>
  
  <pre><code>let headerStackView: UIStackView = {
    let headerArray = [welcomeLabel]
    let stackView = UIStackView(arrangedSubviews: headerArray)
  </code></pre>