Using Autolayout Visual Format with Swift?

后端 未结 9 1983
执笔经年
执笔经年 2021-02-01 14:57

I\'ve been trying to use the Autolayout Visual Format Language in Swift, using NSLayoutConstraint.constraintsWithVisualFormat. Here\'s an example of some code that

9条回答
  •  太阳男子
    2021-02-01 15:58

    Try this - remove the initial variable name (format:), use NSLayoutFormatOptions(0), and just pass nil for those optional NSDictionaries:

    let foo:[AnyObject]! = NSLayoutConstraint.constraintsWithVisualFormat("", options: NSLayoutFormatOptions(0), metrics: nil, views: nil)
    

提交回复
热议问题