I get an error message:
Invalid parameter that does not satisfy: [constraint isKindOfClass: [NSLayoutConstraint class]]
for my auto-layout constraint code written in Swift:
let d:NSDictionary = ["scrollView": scrollView] let hc:NSArray = [NSLayoutConstraint.constraintsWithVisualFormat("H:|[scrollView]|", options: NSLayoutFormatOptions.allZeros, metrics: nil, views: d)] let vc:NSArray = [NSLayoutConstraint.constraintsWithVisualFormat("V:|[scrollView]|", options: NSLayoutFormatOptions.allZeros, metrics: nil, views: d)] view.addConstraints(hc) view.addConstraints(vc)
Does anyone have an idea what this error is trying to tell me? As far as I know, the parameter is of type NSArray with NSLayoutConstraint objects in it. I suspected that I should explicitly define arrays as NSArray , but not solving it.
source share