Skip to content

Commit

Permalink
Reorder size methods
Browse files Browse the repository at this point in the history
  • Loading branch information
tinder-cfuller committed Feb 24, 2024
1 parent 2ecd668 commit 3155d89
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Sources/Layout/LayoutItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,34 +114,34 @@ extension LayoutItem {
/// Adds constraints defining the size of the ``layoutItemView``.
///
/// - Parameters:
/// - width: The width value.
/// - height: The height value.
/// - size: The size value.
/// - priority: The priority of the constraints.
///
/// - Returns: The layout item instance with the added constraints.
public func size(
width: CGFloat,
height: CGFloat,
_ size: CGSize,
priority: UILayoutPriority = .required
) -> LayoutItem {
addingSuperviewConstraints { layoutItem in
layoutItem.layoutItemView.sizeConstraints(width: width, height: height).withPriority(priority)
layoutItem.layoutItemView.sizeConstraints(size).withPriority(priority)
}
}

/// Adds constraints defining the size of the ``layoutItemView``.
///
/// - Parameters:
/// - size: The size value.
/// - width: The width value.
/// - height: The height value.
/// - priority: The priority of the constraints.
///
/// - Returns: The layout item instance with the added constraints.
public func size(
_ size: CGSize,
width: CGFloat,
height: CGFloat,
priority: UILayoutPriority = .required
) -> LayoutItem {
addingSuperviewConstraints { layoutItem in
layoutItem.layoutItemView.sizeConstraints(size).withPriority(priority)
layoutItem.layoutItemView.sizeConstraints(width: width, height: height).withPriority(priority)
}
}

Expand Down

0 comments on commit 3155d89

Please sign in to comment.