Skip to content

Commit

Permalink
LayoutItem code cleanup (two methods)
Browse files Browse the repository at this point in the history
  • Loading branch information
tinder-cfuller committed Feb 19, 2024
1 parent 2a2d4c6 commit c6440ff
Showing 1 changed file with 6 additions and 5 deletions.
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

0 comments on commit c6440ff

Please sign in to comment.