diff --git a/Sources/Layout/LayoutItem.swift b/Sources/Layout/LayoutItem.swift index 30fa4f6a..d0fc2140 100644 --- a/Sources/Layout/LayoutItem.swift +++ b/Sources/Layout/LayoutItem.swift @@ -20,17 +20,10 @@ public typealias SuperviewConstraints = (LayoutItem) -> [NSLayoutConstraint] * Each subview and its constraints are stored as a `LayoutItem` instance within a ``Layout``. A `LayoutItem` extension * is provided that defines the declarative methods used to create constraints for the subviews within a layout. * - * A layout item must be added to a `Layout` in order to activate its constraints, as the following code demonstrates: + * A layout item must be added to a `Layout` in order to activate its constraints, as shown in the following code: * * ```swift - * // Creating a layout with a single item - * let item: LayoutItem = subview.toEdges() - * view.layout(item).activate() - * - * // Creating a layout with multiple items - * let item1: LayoutItem = subview1.toEdges() - * let item2: LayoutItem = subview2.square().center() - * view.layout(item1).addItem(item2).activate() + * view.layout(subview.toEdges()).activate() * ``` * * The following code demonstrates the preferred way of constructing and activating a layout with multiple items diff --git a/Tests/LayoutTests/LayoutExampleTests.swift b/Tests/LayoutTests/LayoutExampleTests.swift index 7d2eda62..c3766dbd 100644 --- a/Tests/LayoutTests/LayoutExampleTests.swift +++ b/Tests/LayoutTests/LayoutExampleTests.swift @@ -175,38 +175,6 @@ final class LayoutExampleTests: XCTestCase { // MARK: - LayoutItem - @MainActor - func testSingleLayoutItemDocumentationExample() { - - // GIVEN - - let subview: UIView = .blue() - - // THEN - - assertLayout { view in - let item: LayoutItem = subview.toEdges() - view.layout(item).activate() - } - } - - @MainActor - func testMultipleLayoutItemsDocumentationExample() { - - // GIVEN - - let subview1: UIView = .orange() - let subview2: UIImageView = .init(image: .checkmark) - - // THEN - - assertLayout { view in - let item1: LayoutItem = subview1.toEdges() - let item2: LayoutItem = subview2.square().center() - view.layout(item1).addItem(item2).activate() - } - } - @MainActor func testHorizontallyCenteringLayoutItemDocumentationExample() { diff --git a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-13-mini-portrait.png b/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-13-mini-portrait.png deleted file mode 100644 index 54571e95..00000000 Binary files a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-13-mini-portrait.png and /dev/null differ diff --git a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-13-mini-portrait.txt b/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-13-mini-portrait.txt deleted file mode 100644 index c71727d0..00000000 --- a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-13-mini-portrait.txt +++ /dev/null @@ -1,3 +0,0 @@ - - | - | ; layer = > \ No newline at end of file diff --git a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-13-portrait.png b/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-13-portrait.png deleted file mode 100644 index db52c0c1..00000000 Binary files a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-13-portrait.png and /dev/null differ diff --git a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-13-portrait.txt b/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-13-portrait.txt deleted file mode 100644 index bb066ba4..00000000 --- a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-13-portrait.txt +++ /dev/null @@ -1,3 +0,0 @@ - - | - | ; layer = > \ No newline at end of file diff --git a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-8-portrait.png b/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-8-portrait.png deleted file mode 100644 index 7a1d2749..00000000 Binary files a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-8-portrait.png and /dev/null differ diff --git a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-8-portrait.txt b/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-8-portrait.txt deleted file mode 100644 index 88187cc3..00000000 --- a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-8-portrait.txt +++ /dev/null @@ -1,3 +0,0 @@ - - | - | ; layer = > \ No newline at end of file diff --git a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-SE-portrait.png b/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-SE-portrait.png deleted file mode 100644 index b7bbf594..00000000 Binary files a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-SE-portrait.png and /dev/null differ diff --git a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-SE-portrait.txt b/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-SE-portrait.txt deleted file mode 100644 index 8ff54322..00000000 --- a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-SE-portrait.txt +++ /dev/null @@ -1,3 +0,0 @@ - - | - | ; layer = > \ No newline at end of file diff --git a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-X-portrait.png b/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-X-portrait.png deleted file mode 100644 index 54571e95..00000000 Binary files a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-X-portrait.png and /dev/null differ diff --git a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-X-portrait.txt b/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-X-portrait.txt deleted file mode 100644 index c71727d0..00000000 --- a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testMultipleLayoutItemsDocumentationExample.iPhone-X-portrait.txt +++ /dev/null @@ -1,3 +0,0 @@ - - | - | ; layer = > \ No newline at end of file diff --git a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-13-mini-portrait.png b/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-13-mini-portrait.png deleted file mode 100644 index b686bfb2..00000000 Binary files a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-13-mini-portrait.png and /dev/null differ diff --git a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-13-mini-portrait.txt b/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-13-mini-portrait.txt deleted file mode 100644 index a8609b58..00000000 --- a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-13-mini-portrait.txt +++ /dev/null @@ -1,2 +0,0 @@ - - | \ No newline at end of file diff --git a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-13-portrait.png b/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-13-portrait.png deleted file mode 100644 index 26411ac1..00000000 Binary files a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-13-portrait.png and /dev/null differ diff --git a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-13-portrait.txt b/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-13-portrait.txt deleted file mode 100644 index 488811c7..00000000 --- a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-13-portrait.txt +++ /dev/null @@ -1,2 +0,0 @@ - - | \ No newline at end of file diff --git a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-8-portrait.png b/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-8-portrait.png deleted file mode 100644 index 18fcc91f..00000000 Binary files a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-8-portrait.png and /dev/null differ diff --git a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-8-portrait.txt b/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-8-portrait.txt deleted file mode 100644 index 51d3108e..00000000 --- a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-8-portrait.txt +++ /dev/null @@ -1,2 +0,0 @@ - - | \ No newline at end of file diff --git a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-SE-portrait.png b/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-SE-portrait.png deleted file mode 100644 index 5e67603d..00000000 Binary files a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-SE-portrait.png and /dev/null differ diff --git a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-SE-portrait.txt b/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-SE-portrait.txt deleted file mode 100644 index 538df4bd..00000000 --- a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-SE-portrait.txt +++ /dev/null @@ -1,2 +0,0 @@ - - | \ No newline at end of file diff --git a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-X-portrait.png b/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-X-portrait.png deleted file mode 100644 index b686bfb2..00000000 Binary files a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-X-portrait.png and /dev/null differ diff --git a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-X-portrait.txt b/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-X-portrait.txt deleted file mode 100644 index a8609b58..00000000 --- a/Tests/LayoutTests/__Snapshots__/LayoutExampleTests/testSingleLayoutItemDocumentationExample.iPhone-X-portrait.txt +++ /dev/null @@ -1,2 +0,0 @@ - - | \ No newline at end of file