title: UIButton changing frame when constraint added
body: <p>I have a circular UIButton inside a UITableViewCell that I'm creating programmatically. It works fine, until I add a constraint to center it in it's superview.</p>
  
  <p>This is what my button looks like before I add the constraint to it: </p>
  
  <p><img src="https://i.stack.imgur.com/LmNhV.png" alt="enter image description here"></p>
  
  <p>And this is what it looks like after I add the constraint: </p>
  
  <p><img src="https://i.stack.imgur.com/elC8u.png" alt="enter image description here"></p>
  
  <p>Here's my code: </p>
  
  <pre><code>var thumbnailBtn = UIButton.buttonWithType(.Custom) as! UIButton
  
  func setupViews() {
      backgroundColor = .colorFromCode(0x3f3f3f)
  
      thumbnailBtn.frame = CGRectMake(0, 0, 80, 80)
      thumbnailBtn.layer.cornerRadius = 0.5 * thumbnailBtn.bounds.size.width
      thumbnailBtn.backgroundColor = UIColor.greenColor()
      thumbnailBtn.setTitle("Test", forState: UIControlState.Normal)
      thumbnailBtn.addTarget(self, action: "buttonAction:", forControlEvents: UIControlEvents.TouchUpInside)
  
      contentView.addSubview(menuControlContainerView)
      menuControlContainerView.addSubview(thumbnailBtn)
  
      updateConstraints()
  }
  
  override func updateConstraints() {
      if !didSetupConstraints {
          UIView.autoSetPriority(1000) {
              self.menuControlContainerView.autoSetContentCompressionResistancePriorityForAxis(.Vertical)
          }
  
          menuControlContainerView.autoPinEdgeToSuperviewEdge(.Top, withInset: 0)
          menuControlContainerView.autoPinEdgeToSuperviewEdge(.Leading, withInset: 0)
          menuControlContainerView.autoPinEdgeToSuperviewEdge(.Trailing, withInset: 0)
          menuControlContainerView.autoPinEdgeToSuperviewEdge(.Bottom, withInset: 0)
  
          thumbnailBtn.autoCenterInSuperview()
  
          didSetupConstraints = true
      }
  
      super.updateConstraints()
  }
  </code></pre>
  
  <p>I noticed if I add this line of code [ <code>thumbnailBtn.autoSetDimensionsToSize(CGSizeMake(80, 80))</code> ] to <code>updateConstraints()</code> it works and looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/FbVS3.png" alt="enter image description here"></p>
  
  <p>But is this the cleanest way to do this since I'm setting the size twice?</p>
  
  <p>Any help will greatly be appreciated. Thanks.</p>