title: Custom UIView using Constraints Programmatically
body: <p>If I create a standard UIView <code>let aView = UIView()</code> and add constraints to it programmatically the view will show on the screen.</p>
  
  <p>However, if I create a custom view that inherits from UIView <code>class CustomView: UIView</code> then instantiate this view <code>let aView = CustomView()</code> and add constraints to it, the view does not appear on the screen.
  But if I add instantiate the custom view with a frame <code>let aView = CustomView(frame: CGRectMake(0,0,100,100))</code> the custom view will appear.</p>
  
  <p>Do you have to supply a frame to a custom view for it to show on the screen? </p>
  
  <p><strong>Updated:</strong></p>
  
  <p>My constraints are</p>
  
  <pre><code>let leftConstraint: NSLayoutConstraint = NSLayoutConstraint(item: aView, attribute: NSLayoutAttribute.Left, relatedBy: NSLayoutRelation.Equal, toItem: self, attribute: NSLayoutAttribute.Left, multiplier: 1.0, constant: 50)
  
  let topConstraint: NSLayoutConstraint = NSLayoutConstraint(item: aView, attribute: NSLayoutAttribute.Top, relatedBy: NSLayoutRelation.Equal, toItem: self, attribute: NSLayoutAttribute.Top, multiplier: 1.0, constant: 0)
  
  let rightConstraint: NSLayoutConstraint = NSLayoutConstraint(item: aView, attribute: NSLayoutAttribute.Right, relatedBy: NSLayoutRelation.Equal, toItem: self, attribute: NSLayoutAttribute.Right, multiplier: 1.0, constant: 0)
  
  let bottomConstraint: NSLayoutConstraint = NSLayoutConstraint(item: aView, attribute: NSLayoutAttribute.Bottom, relatedBy: NSLayoutRelation.Equal, toItem: self, attribute: NSLayoutAttribute.Bottom, multiplier: 1.0, constant: 20)
  </code></pre>
  
  <p>I would like not to have to specify width and height constraints and just let the edges determine the size of the view.</p>
  
  <p>Can this be done?</p>