ArraySection

public struct ArraySection<Model, Element> : DifferentiableSection where Model : Differentiable, Element : Differentiable

A differentiable section with model and array of elements.

Arrays are can not be identify each one and comparing whether has updated from other one. ArraySection is a generic wrapper to hold a model to allow it.

  • The model of section for differentiated with other section.

    Declaration

    Swift

    public var model: Model
  • The array of element in the section.

    Declaration

    Swift

    public var elements: [Element]
  • An identifier value that of model for difference calculation.

    Declaration

    Swift

    @inlinable
    public var differenceIdentifier: Model.DifferenceIdentifier { get }
  • Creates a section with the model and the elements.

    Declaration

    Swift

    @inlinable
    public init<C>(model: Model, elements: C) where Element == C.Element, C : Collection

    Parameters

    model

    A differentiable model of section.

    elements

    The collection of element in the section.

  • Creates a new section reproducing the given source section with replacing the elements.

    Declaration

    Swift

    @inlinable
    public init<C>(source: ArraySection, elements: C) where Element == C.Element, C : Collection

    Parameters

    source

    A source section to reproduce.

    elements

    The collection of elements for the new section.

  • Indicate whether the content of self is equals to the content of the given source section.

    Note

    It’s compared by the model of self and the specified section.

    Declaration

    Swift

    @inlinable
    public func isContentEqual(to source: ArraySection) -> Bool

    Parameters

    source

    A source section to compare.

    Return Value

    A Boolean value indicating whether the content of self is equals to the content of the given source section.

  • Declaration

    Swift

    public static func == (lhs: ArraySection, rhs: ArraySection) -> Bool
  • Declaration

    Swift

    public var debugDescription: String { get }