Skip to content

Commit 0a0deb2

Browse files
authored
Swift 6 Language Mode (pointfreeco#165)
* Address Xcode 16 warnings * Swift 6 Language Mode * Update [email protected]
1 parent b9cfa9a commit 0a0deb2

File tree

7 files changed

+191
-106
lines changed

7 files changed

+191
-106
lines changed

[email protected]

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// swift-tools-version: 6.0
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "swiftui-navigation",
7+
platforms: [
8+
.iOS(.v13),
9+
.macOS(.v10_15),
10+
.tvOS(.v13),
11+
.watchOS(.v6),
12+
],
13+
products: [
14+
.library(
15+
name: "SwiftUINavigation",
16+
targets: ["SwiftUINavigation"]
17+
),
18+
.library(
19+
name: "SwiftUINavigationCore",
20+
targets: ["SwiftUINavigationCore"]
21+
),
22+
],
23+
dependencies: [
24+
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
25+
.package(url: "https://github.com/pointfreeco/swift-case-paths", from: "1.2.2"),
26+
.package(url: "https://github.com/pointfreeco/swift-custom-dump", from: "1.0.0"),
27+
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.0.0"),
28+
],
29+
targets: [
30+
.target(
31+
name: "SwiftUINavigation",
32+
dependencies: [
33+
"SwiftUINavigationCore",
34+
.product(name: "CasePaths", package: "swift-case-paths"),
35+
]
36+
),
37+
.testTarget(
38+
name: "SwiftUINavigationTests",
39+
dependencies: [
40+
"SwiftUINavigation"
41+
]
42+
),
43+
.target(
44+
name: "SwiftUINavigationCore",
45+
dependencies: [
46+
.product(name: "CustomDump", package: "swift-custom-dump"),
47+
.product(name: "XCTestDynamicOverlay", package: "xctest-dynamic-overlay"),
48+
]
49+
),
50+
],
51+
swiftLanguageVersions: [.v6]
52+
)

Sources/SwiftUINavigation/Binding.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@
6161
/// - Parameter isDuplicate: A closure to evaluate whether two elements are equivalent, for
6262
/// purposes of filtering writes. Return `true` from this closure to indicate that the second
6363
/// element is a duplicate of the first.
64-
public func removeDuplicates(by isDuplicate: @escaping (Value, Value) -> Bool) -> Self {
64+
public func removeDuplicates(
65+
by isDuplicate: @Sendable @escaping (Value, Value) -> Bool
66+
) -> Self {
6567
.init(
6668
get: { self.wrappedValue },
6769
set: { newValue, transaction in
@@ -81,7 +83,7 @@
8183
///
8284
/// [FB9404926]: https://gist.github.com/mbrandonw/70df235e42d505b3b1b9b7d0d006b049
8385
public func removeDuplicates() -> Self {
84-
self.removeDuplicates(by: ==)
86+
self.removeDuplicates(by: { $0 == $1 })
8587
}
8688
}
8789

Sources/SwiftUINavigation/Internal/Binding+Internal.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import SwiftUI
33

44
extension Binding {
5-
func didSet(_ perform: @escaping (Value) -> Void) -> Self {
5+
func didSet(_ perform: @escaping @Sendable (Value) -> Void) -> Self {
66
.init(
77
get: { self.wrappedValue },
88
set: { newValue, transaction in

0 commit comments

Comments
 (0)