insert(_:at:)

Inserts a new element into the collection at the specified position.

SyntaxCollection.swift:292
mutating func insert(_ newElement: Element, at i: Index)

Parameters

newElement

The new element to insert into the collection.

i

The position at which to insert the new element. index must be a valid index into the collection.