A simple layout DSL to make your Autolayout life a little easier.
File -> Swift Packages -> Add Package Dependency -> https://github.com/henrik-dmg/HPLayout
.package(url: "https://github.com/henrik-dmg/HPLayout", from: "2.0.0")
Add pod 'HPLayout'
to your Podfile
yourAwesomeView.layout {
$0.leadingAnchor == someOtherView1.trailingAnchor + 8
$0.trailingAnchor <= someOtherView2.trailingAnchor
$0.spanHorizontally(.superView, constant: 4)
}
// or
someOtherView.addSubview(yourAwesomeView) {
$0.leadingAnchor == someOtherView1.trailingAnchor + 8
$0.trailingAnchor <= someOtherView2.trailingAnchor
$0.spanHorizontally(.superView, constant: 4)
}