title: preferredMaxLayoutWidth not working in Swift?
body: <p>I have tried to make a <code>UILabel</code> that is a certain width using <code>preferredMaxLayoutWidth</code> but no matter what I do it won't work. Can you help me? I have tries so many different combinations to make it work.</p>
  
  <pre><code>@IBAction func addBottomTextButton(sender: AnyObject) {
  
     if addBottomTextField.text.isEmpty == false {
        let halfScreenWidth = screenSize.width * 0.5
        let bottomScreenPosition = screenSize.width
        memeBottomText = addBottomTextField.text
        fontName = "Impact"
        let memeBottomTextCaps = memeBottomText.uppercaseString // --&gt; THIS IS A STRING!
  
        labelBottom.text = memeBottomTextCaps
        labelBottom.textColor = UIColor.blackColor()
        labelBottom.textAlignment = .Center
        labelBottom.font = UIFont(name: fontName, size: 32.0)
        labelBottom.sizeToFit()
  
        labelBottom.userInteractionEnabled = true
        labelBottom.adjustsFontSizeToFitWidth = true
        labelBottom.numberOfLines = 1
        labelBottom.preferredMaxLayoutWidth = screenSize.width
        labelBottom.setTranslatesAutoresizingMaskIntoConstraints(true)
  
        var r = CGFloat(halfScreenWidth)
        var s = CGFloat(bottomScreenPosition)
        labelBottom.center = CGPoint(x: r, y: s)
  
        self.view.addSubview(labelBottom)
        self.view.addConstraint(NSLayoutConstraint(item: labelBottom, attribute:
           NSLayoutAttribute.Top, relatedBy: NSLayoutRelation.Equal, toItem: labelBottom,     
           attribute: NSLayoutAttribute.Bottom, multiplier: 1, constant: 0))
  
        dismissKeyboard()
     }
  }
  </code></pre>