title: Programmatically Auto-Layout Functions
body: <p>Im having an issue with these two functions. For func 1: </p>
  
  <pre><code>  func constrainWidth(width: CGFloat) -&gt; [NSLayoutConstraint] {
      let constraints = NSLayoutConstraint.constraintsWithVisualFormat("H:[item(width)]", metrics: ["width" : width], views: ["item" : self])
      self.superview?.addConstraints(constraints)
      return constraints as! [NSLayoutConstraint]
  }
  </code></pre>
  
  <p>I get an error at "self.superview?.addConstraints(constraints)" they have a problem with "constraints"
  and it says:
   <em>cannot convert value of type [Any Object] to expected argument type '[NSLayoutConstraint]'</em></p>
  
  <p>Here is func 2:</p>
  
  <pre><code> class func constraintsWithVisualFormat(visualFormat: String,  options: NSLayoutFormatOptions, views: [NSObject : AnyObject]) -&gt; [AnyObject] {
      return NSLayoutConstraint.constraintsWithVisualFormat(visualFormat, options: options, metrics: nil, views: views)
  }
  </code></pre>
  
  <p>I get an error at "return NSLayoutConstraint.constraintsWithVisualFormat(visualFormat, options: options, metrics: nil, views: views)" they have a problem with "views"
  and it says: *Cannot convert value of type '[NSObject : AnyObject]' to expected argument type '[String : AnyObject]'</p>
  
  <p>These function don't affect one another, i just need help with them both. I didn't have this problem before, it just came up recently i believe because of the new swift.</p>