我改编了:
func addConstraints(format format: String, options: NSLayoutFormatOptions? = nil, metrics: [String: AnyObject]? = nil, views: [String: UIView]) {
addConstraints(NSLayoutConstraint.constraintsWithVisualFormat(format, options: options!, metrics: metrics, views: views))
}
func addUniversalConstraints(format format: String, options: NSLayoutFormatOptions, metrics: [String: AnyObject]? = nil, views: [String: UIView]) {
addConstraints(format: "H:\(format)", options: options, metrics: metrics, views: views)
addConstraints(format: "V:\(format)", options: options, metrics: metrics, views: views)
}
虽然我在这一行没有错误
public func selectRowAtIndex(index: Index) {
selectedRowIndex = index
tableView.selectRowAtIndexPath(
NSIndexPath(forRow: index, inSection: 0),
animated: false,
/**Error->*/ scrollPosition: .Middle)
}
再次感谢您的帮助。 :)