Bindings
-
Describes a source which can be bound.
See moreDeclaration
Swift
public protocol BindingSource -
A binding target that can be used with the
See more<~operator.Declaration
Swift
public struct BindingTarget<Value>: BindingTargetProvider -
Describes an entity which be bond towards.
Declaration
Swift
public protocol BindingTargetProvider -
Binds 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 acompletedevent.let property = MutableProperty(0) let signal = Signal({ /* do some work after some time */ }) property <~ signallet 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
public func <~ <Provider: BindingTargetProvider, Source: BindingSource> (provider: Provider, source: Source) -> Disposable? where Source.Value == Provider.Value, Source.Error == NoErrorParameters
targetA target to be bond to.
sourceA source to bind.
Return Value
A disposable that can be used to terminate binding before the deinitialization of the target or the source’s
completedevent. -
Binds 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 acompletedevent.let property = MutableProperty(0) let signal = Signal({ /* do some work after some time */ }) property <~ signallet 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
public func <~ <Provider: BindingTargetProvider, Source: BindingSource> (provider: Provider, source: Source) -> Disposable? where Provider.Value: OptionalProtocol, Source.Value == Provider.Value.Wrapped, Source.Error == NoErrorParameters
targetA target to be bond to.
sourceA source to bind.
Return Value
A disposable that can be used to terminate binding before the deinitialization of the target or the source’s
completedevent.
View on GitHub
Install in Dash
Bindings Reference