I have scroll view as @IBOutlet
@IBOutlet weak var mainScrollView: UIScrollView!
I want to change the
"Bottom space to: Bottom Layout Guide"
constraint programmatically.
First Item : Bottom Layout Guide.Top
Relation : Equal
Second Item: Scroll View.Bottom
Constant: 0 -> 50 // (I want to change this programmatically)
Priority: 1000
Multiplier: 1
How can I do this?
Take the constraint as IBOutlet
of NSLayoutConstraint
.
Set the constraint outlets and change constant
value by :
self.sampleConstraint.constant = 20
self.view.layoutIfNeeded()