ArrayProperty
open class ArrayProperty<Element> : AsyncReadablePropertyType where Element : ArrayElement
Undocumented
-
Declaration
Swift
public typealias Value = [Element] -
Declaration
Swift
public typealias SignalChange = [ArrayChange<Element>] -
Undocumented
Declaration
Swift
public internal(set) var elements: [Element] -
Declaration
Swift
public var value: [Element]? { get } -
Declaration
Swift
public let signal: Signal<SignalChange> -
Declaration
Swift
public var property: AsyncReadableProperty<[Element]> { get } -
Returns the index of the element with the given ID, relative to the sorted elements array.
Declaration
Swift
public func indexForID(_ id: Element.ID) -> Int? -
Returns the element with the given ID.
Declaration
Swift
public func elementForID(_ id: Element.ID) -> Element? -
Returns an order value that would be appropriate for an element to be inserted at the given position, relative the current array. Note: This only works when there is a distinct
order
property for each element of type Double.Declaration
Swift
public func orderForPos(_ pos: ArrayPos<Element>) -> Double -
Returns an order value that would be appropriate for an element to be moved from its current index to the new destination index. Note: This only works when there is a distinct
order
property for each element of type Double. Note: dstIndex is relative to the state of the array after the item is removed.Declaration
Swift
public func orderForMove(srcIndex: Int, dstIndex: Int) -> Double -
Returns a view on this ArrayProperty that delivers the full array through its Signal whenever there is any change in the underlying ArrayProperty.
Declaration
Swift
public func fullArray() -> AsyncReadableProperty<[Element]>
ArrayProperty Class Reference