File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 9
9
#if canImport(UIKit)
10
10
import UIKit
11
11
12
+ public class SteviaLayoutConstraint : NSLayoutConstraint {
13
+ public static defaultPriority: Float = UILayoutPriority. defaultHigh + 1
14
+ }
15
+
16
+
12
17
// MARK: - Shortcut
13
18
14
19
public extension UIView {
@@ -76,11 +81,11 @@ public extension UIView {
76
81
attribute attr2: NSLayoutConstraint . Attribute ? = nil , // Not an attribute??
77
82
multiplier: Double = 1 ,
78
83
constant: Double = 0 ) -> NSLayoutConstraint {
79
- let c = NSLayoutConstraint ( item: view1, attribute: attr1,
84
+ let c = SteviaLayoutConstraint ( item: view1, attribute: attr1,
80
85
relatedBy: relatedBy,
81
86
toItem: view2, attribute: ( ( attr2 == nil ) ? attr1 : attr2! ) ,
82
87
multiplier: CGFloat ( multiplier) , constant: CGFloat ( constant) )
83
- c. priority = UILayoutPriority ( rawValue: UILayoutPriority . defaultHigh . rawValue + 1 )
88
+ c. priority = UILayoutPriority ( rawValue: SteviaLayoutConstraint . defaultPriority )
84
89
return c
85
90
}
86
91
@@ -98,8 +103,7 @@ public extension UIView {
98
103
*/
99
104
var userAddedConstraints : [ NSLayoutConstraint ] {
100
105
return constraints. filter { c in
101
- guard let cId = c. identifier else { return true }
102
- return !cId. contains ( " UIView-Encapsulated-Layout " ) && !cId. contains ( " Margin-guide-constraint " )
106
+ c is SteviaLayoutConstraint
103
107
}
104
108
}
105
109
}
You can’t perform that action at this time.
0 commit comments