Skip to content

Commit 339ba3e

Browse files
authored
Fix some sendability errors for Xcodde 16.1 (pointfreeco#203)
1 parent 93d46bf commit 339ba3e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Sources/SwiftUINavigation/Binding.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
/// element is a duplicate of the first.
6363
public func removeDuplicates(
6464
by isDuplicate: @Sendable @escaping (Value, Value) -> Bool
65-
) -> Self {
65+
) -> Self where Value: Sendable {
6666
.init(
6767
get: { self.wrappedValue },
6868
set: { newValue, transaction in
@@ -73,7 +73,7 @@
7373
}
7474
}
7575

76-
extension Binding where Value: Equatable {
76+
extension Binding where Value: Equatable, Value: Sendable {
7777
/// Creates a binding that ignores writes to its wrapped value when equivalent to the new value.
7878
///
7979
/// Useful to minimize writes to bindings passed to SwiftUI APIs. For example, [`NavigationLink`
@@ -86,7 +86,7 @@
8686
}
8787
}
8888

89-
extension Binding {
89+
extension Binding where Value: Sendable {
9090
public func _printChanges(_ prefix: String = "") -> Self {
9191
Self(
9292
get: { self.wrappedValue },

Sources/SwiftUINavigation/Internal/Binding+Internal.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#if canImport(SwiftUI)
22
import SwiftUI
33

4-
extension Binding {
4+
extension Binding where Value: Sendable {
55
func didSet(_ perform: @escaping @Sendable (Value) -> Void) -> Self {
66
.init(
77
get: { self.wrappedValue },

Sources/SwiftUINavigation/NavigationLink.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
@available(macOS, introduced: 10.15, deprecated: 13)
5555
@available(tvOS, introduced: 13, deprecated: 16)
5656
@available(watchOS, introduced: 6, deprecated: 9)
57-
public init<Item, WrappedDestination>(
57+
public init<Item: Sendable, WrappedDestination>(
5858
item: Binding<Item?>,
5959
onNavigate: @escaping @Sendable (_ isActive: Bool) -> Void,
6060
@ViewBuilder destination: @escaping (Binding<Item>) -> WrappedDestination,

0 commit comments

Comments
 (0)