From 21b0eeef4b5dcf333dda67ec6468dc549f4c0462 Mon Sep 17 00:00:00 2001 From: kean Date: Thu, 18 Jun 2020 09:12:04 -0400 Subject: [PATCH] Cleanup --- Sources/Align.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Sources/Align.swift b/Sources/Align.swift index b1d05e8..4975599 100644 --- a/Sources/Align.swift +++ b/Sources/Align.swift @@ -253,13 +253,6 @@ public struct AnchorCollectionEdges { let item: LayoutItem var isAbsolute = false - private var anchors: [Anchor] { - let attributes = isAbsolute ? - [NSLayoutConstraint.Attribute.left, .bottom, .right, .top] : - [NSLayoutConstraint.Attribute.leading, .bottom, .trailing, .top] - return attributes.map { Anchor(item, $0) } - } - // By default, edges use locale-specific `.leading` and `.trailing` public func absolute() -> AnchorCollectionEdges { AnchorCollectionEdges(item: item, isAbsolute: true) @@ -273,6 +266,13 @@ public struct AnchorCollectionEdges { // MARK: Core + private var anchors: [Anchor] { + let attributes = isAbsolute ? + [NSLayoutConstraint.Attribute.left, .bottom, .right, .top] : + [NSLayoutConstraint.Attribute.leading, .bottom, .trailing, .top] + return attributes.map { Anchor(item, $0) } + } + @discardableResult public func equal(_ collection: AnchorCollectionEdges, insets: EdgeInsets) -> [NSLayoutConstraint] { zip(anchors, collection.anchors).map { $0.equal($1, constant: insets.inset(for: $0.attribute, edge: true)) } }