BindingTargetProvider
public protocol BindingTargetProvider
Describes an entity which be bond towards.
-
<~(_:_:)
Extension methodBinds a source to a target, updating the target’s value to the latest value sent by the source.
Note
The binding will automatically terminate when the target is deinitialized, or when the source sends acompleted
event.let property = MutableProperty(0) let signal = Signal({ /* do some work after some time */ }) property <~ signal
let property = MutableProperty(0) let signal = Signal({ /* do some work after some time */ }) let disposable = property <~ signal ... // Terminates binding before property dealloc or signal's // `completed` event. disposable.dispose()
Declaration
Swift
@discardableResult public static func <~ <Source: BindingSource> (provider: Self, source: Source) -> Disposable? where Source.Value == Value
Parameters
target
A target to be bond to.
source
A source to bind.
Return Value
A disposable that can be used to terminate binding before the deinitialization of the target or the source’s
completed
event. -
<~(_:_:)
Extension methodBinds a source to a target, updating the target’s value to the latest value sent by the source.
Note
The binding will automatically terminate when the target is deinitialized, or when the source sends acompleted
event.let property = MutableProperty(0) let signal = Signal({ /* do some work after some time */ }) property <~ signal
let property = MutableProperty(0) let signal = Signal({ /* do some work after some time */ }) let disposable = property <~ signal ... // Terminates binding before property dealloc or signal's // `completed` event. disposable.dispose()
Declaration
Swift
@discardableResult public static func <~ <Source: BindingSource> (provider: Self, source: Source) -> Disposable? where Value == Source.Value?
Parameters
target
A target to be bond to.
source
A source to bind.
Return Value
A disposable that can be used to terminate binding before the deinitialization of the target or the source’s
completed
event.