From ab632017ed950434351f2738354e3ac88b36d435 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 9 Jun 2025 17:48:53 +0100 Subject: [PATCH] Change keypath BindingTarget initializer to use a ReferenceWritableKeyPath instead of a WritableKeyPath in order to resolve source breaking change in SE-0481. --- Sources/UnidirectionalBinding.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/UnidirectionalBinding.swift b/Sources/UnidirectionalBinding.swift index b7b341e71..345b62871 100644 --- a/Sources/UnidirectionalBinding.swift +++ b/Sources/UnidirectionalBinding.swift @@ -185,7 +185,7 @@ public struct BindingTarget: BindingTargetProvider { /// - lifetime: The expected lifetime of any bindings towards `self`. /// - object: The object to consume values. /// - keyPath: The key path of the object that consumes values. - public init(on scheduler: Scheduler = ImmediateScheduler(), lifetime: Lifetime, object: Object, keyPath: WritableKeyPath) { + public init(on scheduler: Scheduler = ImmediateScheduler(), lifetime: Lifetime, object: Object, keyPath: ReferenceWritableKeyPath) { self.init(on: scheduler, lifetime: lifetime) { [weak object] in object?[keyPath: keyPath] = $0 } } }