Instance Methodswift 6.1.2Swift
insert(_:at:)
mutating func insert(_ newElement: Base.Element, at i: Slice<Base>.Index) mutating func insert(_ newElement: Base.Element, at i: Slice<Base>.Index) where Base:RangeReplaceableCollectionimport Swift@frozen struct Slice<Base> where Base : CollectionA view into a subsequence of elements of another collection.
associatedtype Element where Self.Element == Self.Iterator.ElementA type representing the sequence’s elements.
protocol RangeReplaceableCollection<Element> : Collection where Self.SubSequence : RangeReplaceableCollectionA collection that supports replacement of an arbitrary subrange of elements with the elements of another collection.
init() init<S>(_ elements: S) where S : Sequence, Base.Element == S.Element init(repeating repeatedValue: Base.Element, count: Int) mutating func insert<S>(contentsOf newElements: S, at i: Slice<Base>.Index) where S : Collection, Base.Element == S.Element mutating func remove(at i: Slice<Base>.Index) -> Base.Element mutating func removeSubrange(_ bounds: Range<Slice<Base>.Index>) mutating func replaceSubrange<C>(_ subRange: Range<Slice<Base>.Index>, with newElements: C) where C : Collection, Base.Element == C.Element