Skip to content

Commit

Permalink
Move ViewLayoutItem to ViewLayoutItem.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
tinder-garricnahapetian committed Oct 17, 2023
1 parent c5224d8 commit 219e752
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
19 changes: 0 additions & 19 deletions Sources/Layout/LayoutItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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? {
Expand Down Expand Up @@ -521,7 +503,6 @@ extension LayoutItem {
}
}

// swiftlint:disable:next no_grouping_extension
extension ViewLayoutItem: LayoutAnchoring {

public var left: NSLayoutXAxisAnchor { layoutItemView.left }
Expand Down
24 changes: 24 additions & 0 deletions Sources/Layout/ViewLayoutItem.swift
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit 219e752

Please sign in to comment.