Skip to content

Commit

Permalink
Refactor map to single line
Browse files Browse the repository at this point in the history
  • Loading branch information
tinder-cfuller committed Feb 21, 2024
1 parent 2a2d4c6 commit 6421190
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions Sources/Layout/UIKit/UIView+AutoLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,7 @@ extension UIView {
multiplier: CGFloat = 1,
constant: CGFloat = 0
) -> [NSLayoutConstraint] {
attributes.map { attribute in
constraint(is: relation,
toSuperview: attribute,
multiplier: multiplier,
constant: constant)
}
attributes.map { constraint(is: relation, toSuperview: $0, multiplier: multiplier, constant: constant) }
}

/// Creates constraints defining the relationship between the given attributes of the receiver and target view.
Expand All @@ -291,13 +286,7 @@ extension UIView {
multiplier: CGFloat = 1,
constant: CGFloat = 0
) -> [NSLayoutConstraint] {
attributes.map { attribute in
constraint(is: relation,
to: attribute,
of: targetView,
multiplier: multiplier,
constant: constant)
}
attributes.map { constraint(is: relation, to: $0, of: targetView, multiplier: multiplier, constant: constant) }
}

// swiftlint:enable function_default_parameter_at_end
Expand Down

0 comments on commit 6421190

Please sign in to comment.