New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Asking for (x, y) settable anchor methods interface. #274
Comments
Hello, first of all, thank you for your interest in SwiftLayout. First, let's explain why this interface was developed. Anchors interfaces has two main parts:
For property interfaces, they are written to have a 1:1 mapping to However, if I only implement the interface with a 1:1 mapping to Anchors {
Anchors.width.equalTo(constant: width)
Anchors.height.equalTo(constant: height)
} So, I also added an interface in the form of a method to reduce unnecessary repetition like below. Anchors {
Anchors.size(width: width, height: height)
} Next, I'd like to positively review your suggestions for the following reasons.
Thanks again for the great suggestions. |
Awesome~ solved doubt! Yes. I also think developing it is possible, but also curious API design. |
Improved in PR #276. |
Hello. I am recently using SwiftLayout, and familiar to SnapKit.
Using SwiftLayout, I have found (x, y) settable anchor's interface unfamiliar.
Anchors.center.equaltToSuper(x, y)
Anchors.size(superView, x: 0, y: 0)
. I think it should beAnchors.size.equaltToSuper()
if possible.Could we make
AnchorsExpression<AnchorsXYAxisAttribute>
andextension AnchorsExpression where Attribute == AnchorsXYAxisAttribute { func equaltToSuper(x, y) { ... } ... }
It's my opinion. Thanks.
The text was updated successfully, but these errors were encountered: