From d66051a91efcadfa09adb67f6eaaa8dd76b34187 Mon Sep 17 00:00:00 2001 From: Christopher Fuller Date: Tue, 30 Jan 2024 16:45:53 -0800 Subject: [PATCH] Reorder square method (#314) --- Sources/Layout/LayoutItem.swift | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Sources/Layout/LayoutItem.swift b/Sources/Layout/LayoutItem.swift index 61f0daef..5e69675d 100644 --- a/Sources/Layout/LayoutItem.swift +++ b/Sources/Layout/LayoutItem.swift @@ -212,14 +212,7 @@ extension LayoutItem { } } - // MARK: - Aspect Ratio - - /// Adds a constraint defining a square aspect ratio for the ``layoutItemView``. - /// - /// - Returns: The layout item instance with the added constraint. - public func square() -> LayoutItem { - aspectRatio(1) - } + // MARK: - Square /// Adds constraints defining the width and height of the ``layoutItemView`` to be the given length. /// @@ -238,6 +231,15 @@ extension LayoutItem { } } + /// Adds a constraint defining a square aspect ratio for the ``layoutItemView``. + /// + /// - Returns: The layout item instance with the added constraint. + public func square() -> LayoutItem { + aspectRatio(1) + } + + // MARK: - Aspect Ratio + /// Adds a constraint defining the ratio of the width to the height of the ``layoutItemView``. /// /// - Parameters: