Right now if I want to set the margin equally on the left and right side, it requires two lines:
label.snp.makeConstraints { make in
make.left.equalTo(Constants.margin)
make.right.equalTo(-Constants.margin)
}
The API also allows me to set all 4 (left/right/top/bottom) edges at once using:
label.snp.makeConstraints { make in
make.edges.equalTo(Constants.margin
}
How can I write an extension that will allow something like this?
label.snp.makeConstraints { make in
make.horizontalMargins.equalTo(Constants.margin)
}
The result should equate to the first code snippet.