-
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.
- Loading branch information
1 parent
c5224d8
commit f4c1cf7
Showing
2 changed files
with
44 additions
and
36 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,44 @@ | ||
// | ||
// 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 Array where Element == NSLayoutConstraint { | ||
|
||
@preconcurrency | ||
@MainActor | ||
@discardableResult | ||
public func activate() -> [NSLayoutConstraint] { | ||
NSLayoutConstraint.activate(self) | ||
return self | ||
} | ||
|
||
@preconcurrency | ||
@MainActor | ||
@discardableResult | ||
public func deactivate() -> [NSLayoutConstraint] { | ||
NSLayoutConstraint.deactivate(self) | ||
return self | ||
} | ||
|
||
@preconcurrency | ||
@MainActor | ||
@discardableResult | ||
public func withPriority( | ||
_ priority: UILayoutPriority | ||
) -> [NSLayoutConstraint] { | ||
map { $0.withPriority(priority) } | ||
} | ||
|
||
@preconcurrency | ||
@MainActor | ||
public func prioritize(_ priority: UILayoutPriority) { | ||
forEach { $0.priority = priority } | ||
} | ||
} |
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