Skip to content

Commit ea2bfd6

Browse files
authored
Merge pull request #20 from corteggo/feature/swift-6
Migrate to Swift 6
2 parents edd754c + 4458874 commit ea2bfd6

File tree

19 files changed

+91
-83
lines changed

19 files changed

+91
-83
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
test:
13-
runs-on: macos-14
13+
runs-on: macos-26
1414
steps:
1515
- uses: actions/checkout@v4.2.2
1616
- name: Run tests
@@ -29,7 +29,7 @@ jobs:
2929
-derivedDataPath DerivedData \
3030
-clonedSourcePackagesDirPath ClonedSourcePackages \
3131
-enableCodeCoverage YES \
32-
-destination 'platform=iOS Simulator,name=iPhone 15' \
32+
-destination 'platform=iOS Simulator,name=iPhone 17' \
3333
| xcpretty --report junit --output test_report.xml
3434
- name: Extract code coverage
3535
run: |

Examples/ComposableNavigation-Examples/ComposableNavigation-Examples.xcodeproj/project.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.

Package.resolved

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

Package.swift

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

33
import PackageDescription
44

Sources/ComposableNavigation/ModalNavigation/ModalNavigation.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import ComposableArchitecture
33

44
/// `ModalNavigation` models state and actions of a commonly used modal view presentation.
55
/// Views can be presented with a certain style and dismissed.
6-
public struct ModalNavigation<Item: Equatable>: Reducer {
7-
public init() {}
6+
public struct ModalNavigation<Item: Equatable>: Reducer
7+
where Item: SendableMetatype {
8+
9+
public init() {}
810

911
public struct State: Equatable {
1012
public var styledItem: StyledItem?
@@ -56,3 +58,7 @@ public struct ModalNavigation<Item: Equatable>: Reducer {
5658
}
5759
}
5860
}
61+
62+
extension ModalNavigation.State: Sendable where Item: Sendable { }
63+
extension ModalNavigation.Action: Sendable where Item: Sendable { }
64+
extension ModalNavigation.StyledItem: Sendable where Item: Sendable { }

Sources/ComposableNavigation/ModalNavigation/ModalNavigationHandler.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ import ComposableArchitecture
88
/// Additionally, it acts as the `UIAdaptivePresentationControllerDelegate` and automatically updates the state
99
/// for pull-to-dismiss for views presented as a sheet.
1010
@MainActor
11-
public class ModalNavigationHandler<ViewProvider: ViewProviding>: NSObject, UIAdaptivePresentationControllerDelegate {
12-
public typealias Item = ViewProvider.Item
11+
public class ModalNavigationHandler<ViewProvider: ViewProviding>: NSObject, UIAdaptivePresentationControllerDelegate
12+
where ViewProvider.Item: SendableMetatype {
13+
14+
public typealias Item = ViewProvider.Item
1315
public typealias Navigation = ModalNavigation<Item>
1416

1517
internal let viewStore: ViewStore<Navigation.State, Navigation.Action>

Sources/ComposableNavigation/ModalNavigation/ModalNavigationViewController.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ import ComposableArchitecture
44
/// A convenience container view controller intended to decouple the content and modal presented views.
55
/// This way the content view can be reused in multiple contexts without
66
/// tying the content view's implementation and the navigation logic together.
7-
public class ModalNavigationViewController<ViewProvider: ViewProviding>: UIViewController {
8-
internal let navigationHandler: ModalNavigationHandler<ViewProvider>
7+
public class ModalNavigationViewController<ViewProvider: ViewProviding>: UIViewController
8+
where ViewProvider.Item: SendableMetatype {
9+
10+
internal let navigationHandler: ModalNavigationHandler<ViewProvider>
911

1012
public convenience init(
1113
contentViewController: UIViewController,

Sources/ComposableNavigation/StackNavigation/StackNavigation.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import OrderedCollections
33

44
/// `StackNavigation` models state and actions of a stack-based scheme for navigating hierarchical content.
55
/// Views can be pushed on the stack or popped from the stack. Even mutations to the whole stack can be performed.
6-
public struct StackNavigation<Item: Equatable>: Reducer {
7-
public init() {}
6+
public struct StackNavigation<Item: Equatable>: Reducer
7+
where Item: SendableMetatype {
8+
9+
public init() {}
810

911
public struct State: Equatable {
1012
public var items: [Item]
@@ -64,3 +66,6 @@ public struct StackNavigation<Item: Equatable>: Reducer {
6466
state.areAnimationsEnabled = animated
6567
}
6668
}
69+
70+
extension StackNavigation.State: Sendable where Item: Sendable { }
71+
extension StackNavigation.Action: Sendable where Item: Sendable { }

Sources/ComposableNavigation/StackNavigation/StackNavigationHandler.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ import OrderedCollections
77
///
88
/// It also supports automatic state updates for popping items via the leading-edge swipe gesture or the long press back-button menu.
99
@MainActor
10-
public class StackNavigationHandler<ViewProvider: ViewProviding>: NSObject, UINavigationControllerDelegate {
11-
public typealias Item = ViewProvider.Item
10+
public class StackNavigationHandler<ViewProvider: ViewProviding>: NSObject, UINavigationControllerDelegate
11+
where ViewProvider.Item: SendableMetatype {
12+
13+
public typealias Item = ViewProvider.Item
1214
public typealias Navigation = StackNavigation<Item>
1315

1416
internal let viewStore: ViewStore<Navigation.State, Navigation.Action>

Sources/ComposableNavigation/StackNavigation/StackNavigationViewController.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import UIKit
22
import ComposableArchitecture
33

44
/// A convenience UINavigationController implementation containing a `StackNavigationHandler`.
5-
public class StackNavigationViewController<ViewProvider: ViewProviding>: UINavigationController {
6-
internal let navigationHandler: StackNavigationHandler<ViewProvider>
5+
public class StackNavigationViewController<ViewProvider: ViewProviding>: UINavigationController
6+
where ViewProvider.Item: SendableMetatype {
7+
8+
internal let navigationHandler: StackNavigationHandler<ViewProvider>
79

810
public convenience init(
911
store: Store<StackNavigation<ViewProvider.Item>.State, StackNavigation<ViewProvider.Item>.Action>,

0 commit comments

Comments
 (0)