Skip to content
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

LayoutItem code cleanup (two methods) #348

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions Sources/Layout/LayoutItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ extension LayoutItem {
priority: UILayoutPriority = .required
) -> LayoutItem {
addingSuperviewConstraints { layoutItem in
layoutItem.layoutItemView.width
.constraint(equalTo: layoutItem.layoutItemView.height, multiplier: ratio)
layoutItem.layoutItemView
.constraint(for: .width, to: .height, of: layoutItem.layoutItemView, multiplier: ratio)
.withPriority(priority)
}
}
Expand Down Expand Up @@ -460,9 +460,10 @@ extension LayoutItem {
) -> LayoutItem {
addingSuperviewConstraints { layoutItem in
for attribute: NSLayoutConstraint.Attribute in attributes {
layoutItem
.layoutItemView
.constraint(for: attribute.canonicalAttribute, toSuperview: attribute, constant: constant)
layoutItem.layoutItemView
.constraint(for: attribute.canonicalAttribute,
toSuperview: attribute,
constant: constant)
.withPriority(priority)
}
}
Expand Down
Loading