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 } } }