Skip to content

Commit 94987c3

Browse files
authored
Swift Language Support: Drop <5.9 (pointfreeco#166)
* Swift Language Support: Drop <5.9 * wip
1 parent 6f16652 commit 94987c3

File tree

9 files changed

+36
-100
lines changed

9 files changed

+36
-100
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ concurrency:
1515

1616
jobs:
1717
library:
18-
runs-on: macos-13
18+
runs-on: macos-14
1919
strategy:
2020
matrix:
2121
xcode:
22-
- '15.0'
23-
- '14.3.1'
22+
- '15.4'
2423

2524
steps:
2625
- uses: actions/checkout@v4
@@ -42,8 +41,8 @@ jobs:
4241
steps:
4342
- uses: compnerd/gha-setup-swift@main
4443
with:
45-
branch: swift-5.9.1-release
46-
tag: 5.9.1-RELEASE
44+
branch: swift-5.10-release
45+
tag: 5.10-RELEASE
4746
- uses: actions/checkout@v4
4847
- name: Build
4948
run: swift build -c ${{ matrix.config }}

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.7.1
1+
// swift-tools-version: 5.9
22

33
import PackageDescription
44

@@ -49,3 +49,10 @@ let package = Package(
4949
),
5050
]
5151
)
52+
53+
for target in package.targets {
54+
target.swiftSettings = target.swiftSettings ?? []
55+
target.swiftSettings!.append(contentsOf: [
56+
.enableExperimentalFeature("StrictConcurrency")
57+
])
58+
}

[email protected]

Lines changed: 0 additions & 63 deletions
This file was deleted.

Sources/SwiftUINavigation/Internal/Deprecations.swift

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212
message:
1313
"Use the 'fullScreenCover(item:)' (or 'fullScreenCover(item:id:)') overload that passes a binding"
1414
)
15-
public func fullScreenCover<Value, Content>(
15+
public func fullScreenCover<Value, Content: View>(
1616
unwrapping value: Binding<Value?>,
1717
onDismiss: (() -> Void)? = nil,
1818
@ViewBuilder content: @escaping (Binding<Value>) -> Content
19-
) -> some View
20-
where Content: View {
19+
) -> some View {
2120
self.fullScreenCover(
2221
isPresented: Binding(value),
2322
onDismiss: onDismiss
@@ -106,12 +105,11 @@
106105
*, deprecated,
107106
message: "Use the 'sheet(item:)' (or 'sheet(item:id:)') overload that passes a binding"
108107
)
109-
public func sheet<Value, Content>(
108+
public func sheet<Value, Content: View>(
110109
unwrapping value: Binding<Value?>,
111110
onDismiss: (() -> Void)? = nil,
112111
@ViewBuilder content: @escaping (Binding<Value>) -> Content
113-
) -> some View
114-
where Content: View {
112+
) -> some View {
115113
self.sheet(isPresented: Binding(value), onDismiss: onDismiss) {
116114
Binding(unwrapping: value).map(content)
117115
}
@@ -363,13 +361,12 @@
363361
message:
364362
"Chain a '@CasePathable' enum binding into a case directly instead of specifying a case path."
365363
)
366-
public func fullScreenCover<Enum, Case, Content>(
364+
public func fullScreenCover<Enum, Case, Content: View>(
367365
unwrapping enum: Binding<Enum?>,
368366
case casePath: AnyCasePath<Enum, Case>,
369367
onDismiss: (() -> Void)? = nil,
370368
@ViewBuilder content: @escaping (Binding<Case>) -> Content
371-
) -> some View
372-
where Content: View {
369+
) -> some View {
373370
fullScreenCover(
374371
unwrapping: `enum`.case(casePath), onDismiss: onDismiss, content: content)
375372
}
@@ -399,13 +396,13 @@
399396
message:
400397
"Chain a '@CasePathable' enum binding into a case directly instead of specifying a case path."
401398
)
402-
public func popover<Enum, Case, Content>(
399+
public func popover<Enum, Case, Content: View>(
403400
unwrapping enum: Binding<Enum?>,
404401
case casePath: AnyCasePath<Enum, Case>,
405402
attachmentAnchor: PopoverAttachmentAnchor = .rect(.bounds),
406403
arrowEdge: Edge = .top,
407404
@ViewBuilder content: @escaping (Binding<Case>) -> Content
408-
) -> some View where Content: View {
405+
) -> some View {
409406
popover(
410407
unwrapping: `enum`.case(casePath),
411408
attachmentAnchor: attachmentAnchor,
@@ -420,13 +417,12 @@
420417
"Chain a '@CasePathable' enum binding into a case directly instead of specifying a case path."
421418
)
422419
@MainActor
423-
public func sheet<Enum, Case, Content>(
420+
public func sheet<Enum, Case, Content: View>(
424421
unwrapping enum: Binding<Enum?>,
425422
case casePath: AnyCasePath<Enum, Case>,
426423
onDismiss: (() -> Void)? = nil,
427424
@ViewBuilder content: @escaping (Binding<Case>) -> Content
428-
) -> some View
429-
where Content: View {
425+
) -> some View {
430426
sheet(unwrapping: `enum`.case(casePath), onDismiss: onDismiss, content: content)
431427
}
432428
}
@@ -528,8 +524,7 @@
528524
}
529525
}
530526

531-
public struct IfCaseLet<Enum, Case: Sendable, IfContent, ElseContent>: View
532-
where IfContent: View, ElseContent: View {
527+
public struct IfCaseLet<Enum, Case: Sendable, IfContent: View, ElseContent: View>: View {
533528
public let `enum`: Binding<Enum>
534529
public let casePath: AnyCasePath<Enum, Case>
535530
public let ifContent: (Binding<Case>) -> IfContent
@@ -605,8 +600,7 @@
605600
}
606601
}
607602

608-
public struct IfLet<Value, IfContent, ElseContent>: View
609-
where IfContent: View, ElseContent: View {
603+
public struct IfLet<Value, IfContent: View, ElseContent: View>: View {
610604
public let value: Binding<Value?>
611605
public let ifContent: (Binding<Value>) -> IfContent
612606
public let elseContent: ElseContent
@@ -770,8 +764,7 @@
770764
message:
771765
"Switch over a '@CasePathable' enum and derive bindings from each case using '$enum.case.map { $case in … }', instead."
772766
)
773-
public struct CaseLet<Enum, Case: Sendable, Content>: Sendable, View
774-
where Content: View {
767+
public struct CaseLet<Enum, Case: Sendable, Content: View>: Sendable, View {
775768
@EnvironmentObject private var `enum`: BindingObject<Enum>
776769
public let casePath: AnyCasePath<Enum, Case>
777770
public let content: (Binding<Case>) -> Content
@@ -1855,7 +1848,7 @@
18551848
action handler: @escaping @Sendable (Value) async -> Void = { (_: Void) async in }
18561849
) -> some View {
18571850
alert(value) { (value: Value?) in
1858-
if let value = value {
1851+
if let value {
18591852
await handler(value)
18601853
}
18611854
}
@@ -1874,7 +1867,7 @@
18741867
action handler: @escaping @Sendable (Value) async -> Void = { (_: Void) async in }
18751868
) -> some View {
18761869
alert(unwrapping: `enum`, case: casePath) { (value: Value?) async in
1877-
if let value = value {
1870+
if let value {
18781871
await handler(value)
18791872
}
18801873
}
@@ -1892,7 +1885,7 @@
18921885
action handler: @escaping @Sendable (Value) async -> Void = { (_: Void) async in }
18931886
) -> some View {
18941887
confirmationDialog(unwrapping: value) { (value: Value?) in
1895-
if let value = value {
1888+
if let value {
18961889
await handler(value)
18971890
}
18981891
}
@@ -1911,7 +1904,7 @@
19111904
action handler: @escaping @Sendable (Value) async -> Void = { (_: Void) async in }
19121905
) -> some View {
19131906
confirmationDialog(unwrapping: `enum`, case: casePath) { (value: Value?) async in
1914-
if let value = value {
1907+
if let value {
19151908
await handler(value)
19161909
}
19171910
}

Sources/SwiftUINavigationCore/AlertState.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188
if !self.buttons.isEmpty {
189189
children.append(("actions", self.buttons))
190190
}
191-
if let message = self.message {
191+
if let message {
192192
children.append(("message", message))
193193
}
194194
return Mirror(

Sources/SwiftUINavigationCore/ConfirmationDialogState.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235
if !self.buttons.isEmpty {
236236
children.append(("actions", self.buttons))
237237
}
238-
if let message = self.message {
238+
if let message {
239239
children.append(("message", message))
240240
}
241241
return Mirror(

Sources/SwiftUINavigationCore/Internal/RuntimeWarnings.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
let message = message()
1313
let category = category ?? "Runtime Warning"
1414
if _XCTIsTesting {
15-
if let file = file, let line = line {
15+
if let file, let line {
1616
XCTFail(message, file: file, line: line)
1717
} else {
1818
XCTFail(message)

SwiftUINavigation.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)