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:倍數(shù)
converWidth.Active = true 約束生效