From 219e752ac3199698d47ce0575b87c8bf37c87afc Mon Sep 17 00:00:00 2001 From: Garric Nahapetian Date: Tue, 17 Oct 2023 15:20:13 -0700 Subject: [PATCH] Move ViewLayoutItem to ViewLayoutItem.swift --- Sources/Layout/LayoutItem.swift | 19 ------------------- Sources/Layout/ViewLayoutItem.swift | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 19 deletions(-) create mode 100644 Sources/Layout/ViewLayoutItem.swift diff --git a/Sources/Layout/LayoutItem.swift b/Sources/Layout/LayoutItem.swift index 1491087b..760782da 100644 --- a/Sources/Layout/LayoutItem.swift +++ b/Sources/Layout/LayoutItem.swift @@ -13,8 +13,6 @@ import UIKit public typealias SuperviewConstraints = (LayoutItem) -> [NSLayoutConstraint] -// swiftlint:disable file_types_order - /// Items to be used with the `Layout` API /// /// - Note: @@ -43,22 +41,6 @@ extension UIView: LayoutItem { } } -// swiftlint:enable file_types_order - -internal final class ViewLayoutItem: LayoutItem { - - internal let layoutItemView: UIView - internal let superviewConstraints: SuperviewConstraints - - internal init( - layoutItemView: UIView, - superviewConstraints: @escaping SuperviewConstraints - ) { - self.layoutItemView = layoutItemView - self.superviewConstraints = superviewConstraints - } -} - extension LayoutItem { public var identifier: String? { @@ -521,7 +503,6 @@ extension LayoutItem { } } -// swiftlint:disable:next no_grouping_extension extension ViewLayoutItem: LayoutAnchoring { public var left: NSLayoutXAxisAnchor { layoutItemView.left } diff --git a/Sources/Layout/ViewLayoutItem.swift b/Sources/Layout/ViewLayoutItem.swift new file mode 100644 index 00000000..ba50a0ad --- /dev/null +++ b/Sources/Layout/ViewLayoutItem.swift @@ -0,0 +1,24 @@ +// +// All Contributions by Match Group +// +// Copyright © 2023 Tinder (Match Group, LLC) +// +// Licensed under the Match Group Modified 3-Clause BSD License. +// See https://github.com/Tinder/Layout/blob/main/LICENSE for license information. +// + +import UIKit + +internal final class ViewLayoutItem: LayoutItem { + + internal let layoutItemView: UIView + internal let superviewConstraints: SuperviewConstraints + + internal init( + layoutItemView: UIView, + superviewConstraints: @escaping SuperviewConstraints + ) { + self.layoutItemView = layoutItemView + self.superviewConstraints = superviewConstraints + } +}