如何以编程方式将视图的底部约束从安全区域更改为超级视图?

how to change bottom constraint of a view from safe area to superview programmatically?

我认为底部被限制在这样的安全区域

我需要将其更改为以编程方式限制为超级视图。

我不知道如何处理该约束引用

 @IBOutlet var sheetViewBottomConstraint: NSLayoutConstraint!

您可以删除故事板上的约束并通过如下代码给出约束:

sheetView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true

注意:要以编程方式更改约束,您不需要 @IBOutlet