@@ -19,11 +19,17 @@ public typealias SLView = UIView
1919public typealias SLStackView = UIStackView
2020public typealias SLColor = UIColor
2121public typealias SLEdgeInsets = UIEdgeInsets
22+ public typealias SLLayoutPriority = UILayoutPriority
23+ public typealias SLAlignment = UIStackView . Alignment
24+ public typealias SLScreen = UIScreen
2225#else
2326public typealias SLView = NSView
2427public typealias SLStackView = NSStackView
2528public typealias SLColor = NSColor
2629public typealias SLEdgeInsets = NSEdgeInsets
30+ public typealias SLLayoutPriority = NSLayoutPriority
31+ public typealias SLAlignment = NSLayoutConstraint . Attribute
32+ public typealias SLScreen = NSScreen
2733#endif
2834
2935fileprivate protocol StackLayoutUpdatable {
@@ -116,7 +122,7 @@ public class StackLayout: SLView, StackLayoutUpdatable {
116122 case firstBaseline
117123 case lastBaseline
118124
119- fileprivate var toAlignment : SLStackView . Alignment {
125+ fileprivate var toAlignment : SLAlignment {
120126 switch self {
121127 case . top:
122128 return . top
@@ -140,7 +146,7 @@ public class StackLayout: SLView, StackLayoutUpdatable {
140146 case right
141147 case fill
142148
143- fileprivate var toAlignment : SLStackView . Alignment {
149+ fileprivate var toAlignment : SLAlignment {
144150 switch self {
145151 case . left:
146152 return . leading
@@ -239,17 +245,17 @@ extension StackLayout {
239245 public func add( views: [ SLView ] ) -> StackLayout {
240246 self . layoutViews = views
241247 self . layoutViews. filter { $0 is StackLayoutStretchable == false } . forEach {
242- $0. setContentCompressionResistancePriority ( UILayoutPriority ( rawValue: 1000 ) , for: orientation == . vertical ? . vertical : . horizontal)
248+ $0. setContentCompressionResistancePriority ( SLLayoutPriority ( rawValue: 1000 ) , for: orientation == . vertical ? . vertical : . horizontal)
243249 }
244250 return self
245251 }
246252
247253 public func flex( bgColor: SLColor = . clear) -> SLView {
248- let width = orientation == . vertical ? 1 : UIScreen . main. bounds. width
249- let height = orientation == . vertical ? UIScreen . main. bounds. height : 1
254+ let width = orientation == . vertical ? 1 : SLScreen . main. bounds. width
255+ let height = orientation == . vertical ? SLScreen . main. bounds. height : 1
250256 let v = StackFlexSpacingView ( width: width, height: height)
251257 v. backgroundColor = bgColor
252- v. setContentCompressionResistancePriority ( UILayoutPriority ( rawValue: 999 ) , for: orientation == . vertical ? . vertical : . horizontal)
258+ v. setContentCompressionResistancePriority ( SLLayoutPriority ( rawValue: 999 ) , for: orientation == . vertical ? . vertical : . horizontal)
253259 return v
254260 }
255261
0 commit comments