-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add internal only
UILayoutGuide
extensions (#345)
- Loading branch information
1 parent
7eaa09a
commit 4e8801d
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |