Skip to content

Commit

Permalink
Merge pull request #10 from finestructure/fix-11.6-build-regression
Browse files Browse the repository at this point in the history
Fix 11.6 build regression
  • Loading branch information
finestructure authored Aug 11, 2020
2 parents 721c403 + b30d98b commit 1856924
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions Sources/Gala/Gala.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,39 @@ public func Layouts<A: View>(_ layouts: [Layout], _ name: String? = nil, @ViewBu
@available(tvOS, unavailable)
@available(watchOS, unavailable)
public func HorizontalSizeClasses<A: View>(_ name: String? = nil, @ViewBuilder items: @escaping () -> A) -> some View {
ForEach([UserInterfaceSizeClass.compact, .regular], id: \.self) { item in
#if swift(<5.3)
#if swift(<5.3)
return ForEach([UserInterfaceSizeClass.compact, .regular], id: \.self) { item in
items()
.previewDisplayName(name.map { "\($0) \(item!)" } ?? "\(item!)")
.environment(\.horizontalSizeClass, item)
#else
}
#else
return ForEach([UserInterfaceSizeClass.compact, .regular], id: \.self) { item in
items()
.previewDisplayName(name.map { "\($0) \(item)" } ?? "\(item)")
.environment(\.horizontalSizeClass, item)
#endif
}
#endif
}


@available(OSX, unavailable)
@available(tvOS, unavailable)
@available(watchOS, unavailable)
public func VerticalSizeClasses<A: View>(_ name: String? = nil, @ViewBuilder items: @escaping () -> A) -> some View {
ForEach([UserInterfaceSizeClass.compact, .regular], id: \.self) { item in
#if swift(<5.3)
#if swift(<5.3)
return ForEach([UserInterfaceSizeClass.compact, .regular], id: \.self) { item in
items()
.previewDisplayName(name.map { "\($0) \(item!)" } ?? "\(item!)")
.environment(\.verticalSizeClass, item)
#else
}
#else
return ForEach([UserInterfaceSizeClass.compact, .regular], id: \.self) { item in
items()
.previewDisplayName(name.map { "\($0) \(item)" } ?? "\(item)")
.environment(\.verticalSizeClass, item)
#endif
}
#endif
}


Expand All @@ -67,17 +71,19 @@ public func LayoutDirections<A: View>(_ name: String? = nil, @ViewBuilder items:


public func LegibilityWeights<A: View>(_ name: String? = nil, @ViewBuilder items: @escaping () -> A) -> some View {
ForEach([LegibilityWeight.regular, .bold], id: \.self) { item in
#if swift(<5.3)
#if swift(<5.3)
return ForEach([LegibilityWeight.regular, .bold], id: \.self) { item in
items()
.previewDisplayName(name.map { "\($0) \(item!)" } ?? "\(item!)")
.environment(\.legibilityWeight, item)
#else
}
#else
return ForEach([LegibilityWeight.regular, .bold], id: \.self) { item in
items()
.previewDisplayName(name.map { "\($0) \(item)" } ?? "\(item)")
.environment(\.legibilityWeight, item)
#endif
}
#endif
}

public func ContentSizeCategories<A: View>(_ name: String? = nil, @ViewBuilder items: @escaping () -> A) -> some View {
Expand Down

0 comments on commit 1856924

Please sign in to comment.