Collection

protocol Collection : Indexable, Sequence
  • Mechanica

    Returns the first index where the specified value appears in the collection. After using firstIndex(of:) to find the last position of a particular element in a collection, you can use it to access the element by subscripting. - Parameter element: Index of the first element found (if any). - Note: Same as index(of:). - SeeAlso: index(of:)

    Declaration

    Swift

    public final func firstIndex(of element: Iterator.Element) -> Self.Index?

    Parameters

    element

    Index of the first element found (if any).

  • Mechanica

    Returns the last index where the specified value appears in the collection. After using lastIndex(of:) to find the last position of a particular element in a collection, you can use it to access the element by subscripting. - Parameter element: Index of the last element found (if any).

    Declaration

    Swift

    public final func lastIndex(of element: Iterator.Element) -> Self.Index?

    Parameters

    element

    Index of the last element found (if any).

  • Mechanica

    Fetches all faulted object in one batch executing a single fetch request for all objects that we’re interested in. - Note: Materializing all objects in one batch is faster than triggering the fault for each object on its own.

    Declaration

    Swift

    public final func fetchFaultedObjects()