Swift 3 - ">>> - "生成NSLayoutConstraint,而不是预期的上下文结果类型" Void"

时间:2016-09-22 14:59:45

标签: ios swift

自Swift 3起,我收到此错误:">>> - "生成NSLayoutConstraint,而不是预期的上下文结果类型" Void" (又名"()")在我的项目中。

fileprivate func configurateCell(_ cell: BasePageCollectionCell, backImage: UIImage?) {
    cell.translatesAutoresizingMaskIntoConstraints = false
    view.addSubview(cell)

// add constraints
[(NSLayoutAttribute.width, cell.bounds.size.width), (NSLayoutAttribute.height, cell.bounds.size.height)].forEach { info in
  cell >>>- {
    $0.attribute = info.0
    $0.constant  = info.1
  }
}

[NSLayoutAttribute.centerX, .centerY].forEach { attribute in
  (view, cell) >>>- { $0.attribute = attribute }
}
cell.layoutIfNeeded()


}

0 个答案:

没有答案