title: UiButton and translatesAutoresizingMaskIntoConstraints
body: <p><strong>My question is a simple one.</strong> </p>
  
  <p>I'm currently subclassing <code>UIButton</code> to create some custom animations. However, when I set the <code>translatesAutoresizingMaskIntoConstraints</code> to <code>false</code>, my view moves to the upper left corner. However when I set it to false OR change the class to <code>UIView</code> or <code>UIControl</code> this problem doesn't appear anymore. </p>
  
  <p><strong>Here is my code:</strong> </p>
  
  <pre><code>class ViewController: UIViewController {
  
  override func viewDidLoad() {
      super.viewDidLoad()
      let button = TestA(frame: CGRectMake(100, 100, 100, 100))
      button.backgroundColor = UIColor.blackColor()
      self.view.addSubview(button)
  
      // Do any additional setup after loading the view, typically from a nib.
  }
  
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
  }
  }
  
  
  class TestA : UIControl {
  
  
  required init?(coder aDecoder: NSCoder) {
      super.init(coder: aDecoder)
  }
  
  override init(frame: CGRect) {
      super.init(frame: frame)
  }
  
  
  }
  </code></pre>
  
  <p><strong>Does anyone know what's going on?</strong> </p>
  
  <p><a href="https://i.stack.imgur.com/qieVb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qieVb.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/yOl99.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yOl99.png" alt="enter image description here"></a></p>