-
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.
Move extension to NSLayoutConstraint-Axis.swift (#180)
* Move extension to NSLayoutConstraint-Axis.swift * Improve implementation Co-authored-by: Christopher Fuller <[email protected]> --------- Co-authored-by: Christopher Fuller <[email protected]>
- Loading branch information
1 parent
4260963
commit 331e575
Showing
2 changed files
with
36 additions
and
27 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,36 @@ | ||
// swiftlint:disable:this file_name | ||
// | ||
// 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 | ||
|
||
extension NSLayoutConstraint.Axis { | ||
|
||
internal var orientation: String { | ||
switch self { | ||
case .horizontal: | ||
return "H" | ||
case .vertical: | ||
return "V" | ||
@unknown default: | ||
return "H" | ||
} | ||
} | ||
|
||
internal var attribute: NSLayoutConstraint.Attribute { | ||
switch self { | ||
case .horizontal: | ||
return .centerX | ||
case .vertical: | ||
return .centerY | ||
@unknown default: | ||
return .centerX | ||
} | ||
} | ||
} |
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