Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Sources/Layout/UIKit/UIView+UILayoutGuide.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// All Contributions by Match Group
//
// Copyright © 2024 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

extension UIView {

internal var margins: UILayoutGuide {
layoutMarginsGuide
}

internal var safeArea: UILayoutGuide {
safeAreaLayoutGuide
}
}
26 changes: 26 additions & 0 deletions Tests/LayoutTests/UIKit/UIViewUILayoutGuideTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// All Contributions by Match Group
//
// Copyright © 2024 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.
//

@testable import Layout
import Nimble
import XCTest

@MainActor
final class UIViewUILayoutGuideTests: XCTestCase {

func testMargins() {
let view: UIView = .init()
expect(view.margins) === view.layoutMarginsGuide
}

func testSafeArea() {
let view: UIView = .init()
expect(view.safeArea) === view.safeAreaLayoutGuide
}
}