@@ -22,18 +22,16 @@ precedencegroup OffsetPrecedence {
2222infix operator |-| : OffsetPrecedence
2323
2424@available ( iOS 10 . 0 , macOS 10 . 12 , tvOS 10 . 0 , * )
25- extension Edge {
26- public static func |-| ( lhs: Edge , rhs: Edge ) -> Dimension {
27- if let first = lhs. xAnchor, let second = rhs. xAnchor {
28- return Dimension ( lhs. context, first. anchorWithOffset ( to: second) )
29- } else if let first = lhs. yAnchor, let second = rhs. yAnchor {
25+ extension EdgeXAxis {
26+ public static func |-| ( lhs: EdgeXAxis , rhs: EdgeXAxis ) -> Dimension {
27+ if let first = lhs. anchor, let second = rhs. anchor {
3028 return Dimension ( lhs. context, first. anchorWithOffset ( to: second) )
3129 } else {
3230 return Dimension ( lhs. context, lhs. item, . notAnAttribute)
3331 }
3432 }
3533
36- internal var xAnchor : NSLayoutXAxisAnchor ? {
34+ internal var anchor : NSLayoutXAxisAnchor ? {
3735 if attribute == . left, let item = item as? SupportsLeftAnchor {
3836 return item. leftAnchor
3937 }
@@ -53,8 +51,19 @@ extension Edge {
5351 return nil
5452 }
5553 }
56-
57- internal var yAnchor : NSLayoutYAxisAnchor ? {
54+ }
55+
56+ @available ( iOS 10 . 0 , macOS 10 . 12 , tvOS 10 . 0 , * )
57+ extension EdgeYAxis {
58+ public static func |-| ( lhs: EdgeYAxis , rhs: EdgeYAxis ) -> Dimension {
59+ if let first = lhs. anchor, let second = rhs. anchor {
60+ return Dimension ( lhs. context, first. anchorWithOffset ( to: second) )
61+ } else {
62+ return Dimension ( lhs. context, lhs. item, . notAnAttribute)
63+ }
64+ }
65+
66+ internal var anchor : NSLayoutYAxisAnchor ? {
5867 if attribute == . top, let item = item as? SupportsTopAnchor {
5968 return item. topAnchor
6069 }
0 commit comments