There are many libraries for simplifying constraints definition from code.
The best one i have found for my self is SnapKit.
Lets say that you have a vertical stack that your want to constraint with it’s parent edges , but your want also to add some edge offset.
vstack.snp.makeConstraints {
(make) -> Void in
make.left.equalToSuperview().offset(30)
make.right.equalToSuperview().offset(-30)
make.bottom.equalToSuperview().offset(-30)
make.top.equalToSuperview().offset(30)
}
SnapKit has also many more extensions that will help you make your constraint definition easier.