PropertyProtocol
public protocol PropertyProtocol: class, 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 -
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, NoError> -
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, NoError>
-
observe(_:during:)Extension methodObserve the property by sending all of future value changes to the given
observerduring the givenlifetime.Declaration
Swift
public func observe(_ observer: Observer<Value, NoError>, during lifetime: Lifetime) -> Disposable?Parameters
observerAn observer to send the events to.
lifetimeA lifetime of the observing object.
-
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>Parameters
transformA closure that will map the current
valueof thisPropertyto a new value.Return Value
A property that holds a mapped value from
self. -
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: PropertyProtocol>(with other: P) -> Property<(Value, P.Value)>Parameters
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: PropertyProtocol>(with other: P) -> Property<(Value, P.Value)>Parameters
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 those values from
selfwhich do not passisRepeatwith respect to the previous value.Declaration
Swift
public func skipRepeats(_ isRepeat: @escaping (Value, Value) -> Bool) -> Property<Value>Parameters
isRepeatA predicate to determine if the two given values are equal.
Return Value
A property that does not emit events for two equal values sequentially.
-
flatMap(_:transform:)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: PropertyProtocol, B: PropertyProtocol>(_ a: A, _ b: B) -> Property<(A.Value, B.Value)> where 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: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol>(_ a: A, _ b: B, _ c: C) -> Property<(A.Value, B.Value, C.Value)> where 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: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D) -> Property<(A.Value, B.Value, C.Value, D.Value)> where 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: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E) -> Property<(A.Value, B.Value, C.Value, D.Value, E.Value)> where 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: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F) -> Property<(A.Value, B.Value, C.Value, D.Value, E.Value, F.Value)> where 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: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G) -> Property<(A.Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value)> where 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: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol, H: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H) -> Property<(A.Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value)> where 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: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol, H: PropertyProtocol, I: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H, _ i: I) -> Property<(A.Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value, I.Value)> where 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: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol, H: PropertyProtocol, I: PropertyProtocol, J: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H, _ i: I, _ j: J) -> Property<(A.Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value, I.Value, J.Value)> where 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: Sequence>(_ properties: S) -> Property<[S.Iterator.Element.Value]>? where S.Iterator.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: PropertyProtocol, B: PropertyProtocol>(_ a: A, _ b: B) -> Property<(A.Value, B.Value)> where 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: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol>(_ a: A, _ b: B, _ c: C) -> Property<(A.Value, B.Value, C.Value)> where 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: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D) -> Property<(A.Value, B.Value, C.Value, D.Value)> where 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: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E) -> Property<(A.Value, B.Value, C.Value, D.Value, E.Value)> where 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: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F) -> Property<(A.Value, B.Value, C.Value, D.Value, E.Value, F.Value)> where 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: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G) -> Property<(A.Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value)> where 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: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol, H: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H) -> Property<(A.Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value)> where 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: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol, H: PropertyProtocol, I: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H, _ i: I) -> Property<(A.Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value, I.Value)> where 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: PropertyProtocol, B: PropertyProtocol, C: PropertyProtocol, D: PropertyProtocol, E: PropertyProtocol, F: PropertyProtocol, G: PropertyProtocol, H: PropertyProtocol, I: PropertyProtocol, J: PropertyProtocol>(_ a: A, _ b: B, _ c: C, _ d: D, _ e: E, _ f: F, _ g: G, _ h: H, _ i: I, _ j: J) -> Property<(A.Value, B.Value, C.Value, D.Value, E.Value, F.Value, G.Value, H.Value, I.Value, J.Value)> where 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: Sequence>(_ properties: S) -> Property<[S.Iterator.Element.Value]>? where S.Iterator.Element: PropertyProtocol
-
skipRepeats()Extension methodForward only those values from
selfwhich do not passisRepeatwith respect to the previous value.Declaration
Swift
public func skipRepeats() -> Property<Value>Return Value
A property that does not emit events for two equal values sequentially.
-
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.
View on GitHub
Install in Dash
PropertyProtocol Protocol Reference