Skip to content

Commit

Permalink
Add private to method
Browse files Browse the repository at this point in the history
  • Loading branch information
tinder-garricnahapetian committed Oct 16, 2023
1 parent e65c50a commit b495760
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Sources/Layout/LayoutItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,45 @@ extension LayoutItem {
}

// swiftlint:enable anonymous_argument_in_multiline_closure

private func to(
_ edge: CanonicalEdge,
of boundary: LayoutBoundary,
insets: UIEdgeInsets,
priority: UILayoutPriority
) -> NSLayoutConstraint {
switch edge {
case .top:
return layoutItemView
.top
.constraint(equalTo: boundary.top, constant: insets.constant(for: .top))
.withPriority(priority)
case .bottom:
return layoutItemView
.bottom
.constraint(equalTo: boundary.bottom, constant: insets.constant(for: .bottom))
.withPriority(priority)
case .left:
return layoutItemView
.left
.constraint(equalTo: boundary.left, constant: insets.constant(for: .left))
.withPriority(priority)
case .right:
return layoutItemView
.right
.constraint(equalTo: boundary.right, constant: insets.constant(for: .right))
.withPriority(priority)
}
}

private func to(
_ edge: CanonicalEdge,
of boundary: LayoutBoundary,
inset: CGFloat,
priority: UILayoutPriority
) -> NSLayoutConstraint {
to(edge, of: boundary, insets: UIEdgeInsets(inset), priority: priority)
}
}

// swiftlint:disable:next no_grouping_extension
Expand Down

0 comments on commit b495760

Please sign in to comment.