Contents

init(capacity:copying:)

Creates a new array with the specified initial capacity, holding a copy of the contents of a given sequence.

Declaration

init(capacity: Int? = nil, copying contents: some Sequence<Element>)

Parameters

  • capacity:

    The storage capacity of the new array, or nil to allocate just enough capacity to store the contents.

  • contents:

    The sequence whose contents to copy into the new array.