RangeReplaceableCollection

extension RangeReplaceableCollection
  • Creates a collection containing the elements of a cursor.

    // [String]
    let cursor = try String.fetchCursor(db, ...)
    let strings = try Array(cursor)
    

    Declaration

    Swift

    public init<C>(_ cursor: C) throws where C : Cursor, Self.Element == C.Element

    Parameters

    cursor

    The cursor whose elements feed the collection.

  • Creates a collection containing the elements of a cursor.

    // [String]
    let cursor = try String.fetchCursor(db, ...)
    let strings = try Array(cursor, minimumCapacity: 100)
    

    Declaration

    Swift

    public init<C>(_ cursor: C, minimumCapacity: Int) throws where C : Cursor, Self.Element == C.Element

    Parameters

    cursor

    The cursor whose elements feed the collection.

    minimumCapacity

    Prepares the returned collection to store the specified number of elements.