PropertyProtocol
public protocol PropertyProtocol : AnyObject, BindingSource
Represents a property that allows observation of its changes.
Only classes can conform to this protocol, because having a signal for changes over time implies the origin must have a unique identity.
-
The current value of the property.
Declaration
Swift
var value: Value { get } -
The values producer of the property.
It produces a signal that sends the property’s current value, followed by all changes over time. It completes when the property has deinitialized, or has no further change.
Note
Ifselfis a composed property, the producer would be bound to the lifetime of its sources.Declaration
Swift
var producer: SignalProducer<Value, Never> { get } -
A signal that will send the property’s changes over time. It completes when the property has deinitialized, or has no further change.
Note
Ifselfis a composed property, the signal would be bound to the lifetime of its sources.Declaration
Swift
var signal: Signal<Value, Never> { get } -
map(_:)Extension methodMaps the current value and all subsequent values to a new property.
Declaration
Swift
public func map<U>(_ transform: @escaping (Value) -> U) -> Property<U>Return Value
A property that holds a mapped value from
self. -
map(value:)Extension methodMap the current value and all susequent values to a new constant property.
Declaration
Swift
public func map<U>(value: U) -> Property<U>Parameters
valueA new value.
Return Value
A property that holds a mapped value from
self. -
map(_:)Extension methodMaps the current value and all subsequent values to a new property by applying a key path.
Declaration
Swift
public func map<U>(_ keyPath: KeyPath<Value, U>) -> Property<U>Parameters
keyPathA key path relative to the property’s
Valuetype.Return Value
A property that holds a mapped value from
self. -
filter(initial:_:)Extension methodPasses only the values of the property that pass the given predicate to a new property.
Declaration
Swift
public func filter(initial: Value, _ predicate: @escaping (Value) -> Bool) -> Property<Value>Parameters
initialpredicateReturn Value
A property that holds only values from
selfpassing the given predicate. -
combineLatest(with:)Extension methodCombines the current value and the subsequent values of two
Propertys in the manner described bySignal.combineLatest(with:).Declaration
Swift
public func combineLatest<P>(with other: P) -> Property<(Value, P.Value)> where P : PropertyProtocolParameters
otherA property to combine
self‘s value with.Return Value
A property that holds a tuple containing values of
selfand the given property. -
zip(with:)Extension methodZips the current value and the subsequent values of two
Propertys in the manner described bySignal.zipWith.Declaration
Swift
public func zip<P>(with other: P) -> Property<(Value, P.Value)> where P : PropertyProtocolParameters
otherA property to zip
self‘s value with.Return Value
A property that holds a tuple containing values of
selfand the given property. -
combinePrevious(_:)Extension methodForward events from
selfwith history: values of the returned property are a tuple whose first member is the previous value and whose second member is the current value.initialis supplied as the first member whenselfsends its first value.Declaration
Swift
public func combinePrevious(_ initial: Value) -> Property<(Value, Value)>Parameters
initialA value that will be combined with the first value sent by
self.Return Value
A property that holds tuples that contain previous and current values of
self. -
skipRepeats(_:)Extension methodForward only values from
selfthat are not considered equivalent to its consecutive predecessor.Note
The first value is always forwarded.
Declaration
Swift
public func skipRepeats(_ isEquivalent: @escaping (Value, Value) -> Bool) -> Property<Value>Parameters
isEquivalentA closure to determine whether two values are equivalent.
Return Value
A property which conditionally forwards values from
self. -
flatMap(_:_:)Extension methodMaps each property from
selfto a new property, then flattens the resulting properties (into a single property), according to the semantics of the given strategy.Declaration
Swift
public func flatMap<P: PropertyProtocol>(_ strategy: FlattenStrategy, _ transform: @escaping (Value) -> P) -> Property<P.Value>Parameters
strategyThe preferred flatten strategy.
transformThe transform to be applied on
selfbefore flattening.Return Value
A property that sends the values of its inner properties.
-
uniqueValues(_:)Extension methodForward only those values from
selfthat have unique identities across the set of all values that have been held.Note
This causes the identities to be retained to check for uniqueness.
Declaration
Swift
public func uniqueValues<Identity: Hashable>(_ transform: @escaping (Value) -> Identity) -> Property<Value>Parameters
transformA closure that accepts a value and returns identity value.
Return Value
A property that sends unique values during its lifetime.
-
combineLatest(_:_:)Extension methodCombines the values of all the given properties, in the manner described by
combineLatest(with:).Declaration
Swift
public static func combineLatest<A, B>(_ a: A, _ b: B) -> Property<(A.Value, B.Value)> where A : PropertyProtocol, B : PropertyProtocol, Self.Value == A.Value -
combineLatest(_:_:_:)Extension methodCombines the values of all the given properties, in the manner described by
combineLatest(with:).Declaration
Swift
public static func combineLatest<A, B, C>(_ a: A, _ b: B, _ c: C) -> Property<(Value, B.Value, C.Value)> where A : PropertyProtocol, B : PropertyProtocol, C : PropertyProtocol, Self.Value == A.Value -
combineLatest(_:_:_:_:)Extension methodCombines the values of all the given properties, in the manner described by
combineLatest(with:).Declaration
Swift
public static func combineLatest<A, B, C, D>(_ a: A, _ b: B, _ c: C, _ d: D) -> Property<(Value, B.Value, C.Value, D.Value)> where A : PropertyProtocol, B : PropertyProtocol, C : PropertyProtocol, D : PropertyProtocol, Self.Value == A.Value -
combineLatest(_:_:_:_:_:)Extension methodCombines the values of all the given properties, in the manner described by
combineLatest(with:).Declaration
Swift
public static func combineLatest<A, B, C, D, E>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E) -> Property<(Value, B.Value, C.Value, D.Value, E.Value)> where A : PropertyProtocol, B : PropertyProtocol, C : PropertyProtocol, D : PropertyProtocol, E : PropertyProtocol, Self.Value == A.Value -
combineLatest(_:_:_:_:_:_:)Extension methodCombines the values of all the given properties, in the manner described by
combineLatest(with:).Declaration
Swift
public static func combineLatest<A, B, C, D, E, F>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value)> where A : PropertyProtocol, B : PropertyProtocol, C : PropertyProtocol, D : PropertyProtocol, E : PropertyProtocol, F : PropertyProtocol, Self.Value == A.Value -
combineLatest(_:_:_:_:_:_:_:)Extension methodCombines the values of all the given properties, in the manner described by
combineLatest(with:).Declaration
Swift
public static func combineLatest<A, B, C, D, E, F, G>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value)> where A : PropertyProtocol, B : PropertyProtocol, C : PropertyProtocol, D : PropertyProtocol, E : PropertyProtocol, F : PropertyProtocol, G : PropertyProtocol, Self.Value == A.Value -
combineLatest(_:_:_:_:_:_:_:_:)Extension methodCombines the values of all the given properties, in the manner described by
combineLatest(with:).Declaration
Swift
public static func combineLatest<A, B, C, D, E, F, G, H>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value)> where A : PropertyProtocol, B : PropertyProtocol, C : PropertyProtocol, D : PropertyProtocol, E : PropertyProtocol, F : PropertyProtocol, G : PropertyProtocol, H : PropertyProtocol, Self.Value == A.Value -
combineLatest(_:_:_:_:_:_:_:_:_:)Extension methodCombines the values of all the given properties, in the manner described by
combineLatest(with:).Declaration
Swift
public static func combineLatest<A, B, C, D, E, F, G, H, I>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H, _ i: I) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value, I.Value)> where A : PropertyProtocol, B : PropertyProtocol, C : PropertyProtocol, D : PropertyProtocol, E : PropertyProtocol, F : PropertyProtocol, G : PropertyProtocol, H : PropertyProtocol, I : PropertyProtocol, Self.Value == A.Value -
combineLatest(_:_:_:_:_:_:_:_:_:_:)Extension methodCombines the values of all the given properties, in the manner described by
combineLatest(with:).Declaration
Swift
public static func combineLatest<A, B, C, D, E, F, G, H, I, J>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H, _ i: I, _ j: J) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value, I.Value, J.Value)> where A : PropertyProtocol, B : PropertyProtocol, C : PropertyProtocol, D : PropertyProtocol, E : PropertyProtocol, F : PropertyProtocol, G : PropertyProtocol, H : PropertyProtocol, I : PropertyProtocol, J : PropertyProtocol, Self.Value == A.Value -
combineLatest(_:)Extension methodCombines the values of all the given producers, in the manner described by
combineLatest(with:). Returns nil if the sequence is empty.Declaration
Swift
public static func combineLatest<S>(_ properties: S) -> Property<[S.Iterator.Element.Value]>? where S : Sequence, S.Element : PropertyProtocol -
zip(_:_:)Extension methodZips the values of all the given properties, in the manner described by
zip(with:).Declaration
Swift
public static func zip<A, B>(_ a: A, _ b: B) -> Property<(Value, B.Value)> where A : PropertyProtocol, B : PropertyProtocol, Self.Value == A.Value -
zip(_:_:_:)Extension methodZips the values of all the given properties, in the manner described by
zip(with:).Declaration
Swift
public static func zip<A, B, C>(_ a: A, _ b: B, _ c: C) -> Property<(Value, B.Value, C.Value)> where A : PropertyProtocol, B : PropertyProtocol, C : PropertyProtocol, Self.Value == A.Value -
zip(_:_:_:_:)Extension methodZips the values of all the given properties, in the manner described by
zip(with:).Declaration
Swift
public static func zip<A, B, C, D>(_ a: A, _ b: B, _ c: C, _ d: D) -> Property<(Value, B.Value, C.Value, D.Value)> where A : PropertyProtocol, B : PropertyProtocol, C : PropertyProtocol, D : PropertyProtocol, Self.Value == A.Value -
zip(_:_:_:_:_:)Extension methodZips the values of all the given properties, in the manner described by
zip(with:).Declaration
Swift
public static func zip<A, B, C, D, E>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E) -> Property<(Value, B.Value, C.Value, D.Value, E.Value)> where A : PropertyProtocol, B : PropertyProtocol, C : PropertyProtocol, D : PropertyProtocol, E : PropertyProtocol, Self.Value == A.Value -
zip(_:_:_:_:_:_:)Extension methodZips the values of all the given properties, in the manner described by
zip(with:).Declaration
Swift
public static func zip<A, B, C, D, E, F>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value)> where A : PropertyProtocol, B : PropertyProtocol, C : PropertyProtocol, D : PropertyProtocol, E : PropertyProtocol, F : PropertyProtocol, Self.Value == A.Value -
zip(_:_:_:_:_:_:_:)Extension methodZips the values of all the given properties, in the manner described by
zip(with:).Declaration
Swift
public static func zip<A, B, C, D, E, F, G>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value)> where A : PropertyProtocol, B : PropertyProtocol, C : PropertyProtocol, D : PropertyProtocol, E : PropertyProtocol, F : PropertyProtocol, G : PropertyProtocol, Self.Value == A.Value -
zip(_:_:_:_:_:_:_:_:)Extension methodZips the values of all the given properties, in the manner described by
zip(with:).Declaration
Swift
public static func zip<A, B, C, D, E, F, G, H>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value)> where A : PropertyProtocol, B : PropertyProtocol, C : PropertyProtocol, D : PropertyProtocol, E : PropertyProtocol, F : PropertyProtocol, G : PropertyProtocol, H : PropertyProtocol, Self.Value == A.Value -
zip(_:_:_:_:_:_:_:_:_:)Extension methodZips the values of all the given properties, in the manner described by
zip(with:).Declaration
Swift
public static func zip<A, B, C, D, E, F, G, H, I>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H, _ i: I) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value, I.Value)> where A : PropertyProtocol, B : PropertyProtocol, C : PropertyProtocol, D : PropertyProtocol, E : PropertyProtocol, F : PropertyProtocol, G : PropertyProtocol, H : PropertyProtocol, I : PropertyProtocol, Self.Value == A.Value -
zip(_:_:_:_:_:_:_:_:_:_:)Extension methodZips the values of all the given properties, in the manner described by
zip(with:).Declaration
Swift
public static func zip<A, B, C, D, E, F, G, H, I, J>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H, _ i: I, _ j: J) -> Property<(Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value, I.Value, J.Value)> where A : PropertyProtocol, B : PropertyProtocol, C : PropertyProtocol, D : PropertyProtocol, E : PropertyProtocol, F : PropertyProtocol, G : PropertyProtocol, H : PropertyProtocol, I : PropertyProtocol, J : PropertyProtocol, Self.Value == A.Value -
zip(_:)Extension methodZips the values of all the given properties, in the manner described by
zip(with:). Returns nil if the sequence is empty.Declaration
Swift
public static func zip<S>(_ properties: S) -> Property<[S.Iterator.Element.Value]>? where S : Sequence, S.Element : PropertyProtocol
-
skipRepeats()Extension methodForward only values from
selfthat are not equal to its consecutive predecessor.Note
The first value is always forwarded.
Declaration
Swift
public func skipRepeats() -> Property<Value>Return Value
A property which conditionally forwards values from
self.
-
flatten(_:)Extension methodFlattens the inner property held by
self(into a single property of values), according to the semantics of the given strategy.Declaration
Swift
public func flatten(_ strategy: FlattenStrategy) -> Property<Value.Value>Parameters
strategyThe preferred flatten strategy.
Return Value
A property that sends the values of its inner properties.
-
uniqueValues()Extension methodForwards only those values from
selfthat are unique across the set of all values that have been seen.Note
This causes the identities to be retained to check for uniqueness. Providing a function that returns a unique value for each sent value can help you reduce the memory footprint.
Declaration
Swift
public func uniqueValues() -> Property<Value>Return Value
A property that sends unique values during its lifetime.
-
negate()Extension methodCreate a property that computes a logical NOT in the latest values of
self.Declaration
Swift
public func negate() -> Property<Value>Return Value
A property that contains the logical NOT results.
-
and(_:)Extension methodCreate a property that computes a logical AND between the latest values of
selfandproperty.Declaration
Swift
public func and<P>(_ property: P) -> Property<Value> where P : PropertyProtocol, P.Value == BoolParameters
propertyProperty to be combined with
self.Return Value
A property that contains the logical AND results.
-
all(_:)Extension methodCreate a property that computes a logical AND between the latest values of
properties.Declaration
Swift
public static func all<P, Properties>(_ properties: Properties) -> Property<Value> where P : PropertyProtocol, P == Properties.Element, Properties : Collection, P.Value == BoolParameters
propertyCollection of properties to be combined.
Return Value
A property that contains the logical AND results.
-
or(_:)Extension methodCreate a property that computes a logical OR between the latest values of
selfandproperty.Declaration
Swift
public func or<P>(_ property: P) -> Property<Value> where P : PropertyProtocol, P.Value == BoolParameters
propertyProperty to be combined with
self.Return Value
A property that contains the logical OR results.
-
any(_:)Extension methodCreate a property that computes a logical OR between the latest values of
properties.Declaration
Swift
public static func any<P, Properties>(_ properties: Properties) -> Property<Value> where P : PropertyProtocol, P == Properties.Element, Properties : Collection, P.Value == BoolParameters
propertiesCollection of properties to be combined.
Return Value
A property that contains the logical OR results.
View on GitHub
Install in Dash
PropertyProtocol Protocol Reference