let coverWidth = NSLayoutConstraint(item: coverImageView, attribute: .width, relatedBy: .equal, toItem: coverImageView.superview, attribute: .width, multiplier: 1, constant: 0)
let coverHeight = NSLayoutConstraint(item: coverImageView, attribute: .height, relatedBy: .equal, toItem: coverImageView.superview, attribute: .height, multiplier: 1, constant: 0)
coverWidth.isActive = true
coverHeight.isActive = true
item:约束的组件
attribute:约束的属性
relatedBy:怎么约束?
tiltem:和谁约束
attribute:和它的什么属性约束
multiplier:倍数
converWidth.Active = true 约束生效