Skip to content

Instance MethodFoundationEssentials

insert(_:at:)

iOS 15.0+ iPadOS 15.0+ Mac Catalyst 15.0+ macOS 12.0+ tvOS 15.0+ watchOS 8.0+
Inserts the specified string at a specific index in the attributed string.
mutating func insert(_ s: some AttributedStringProtocol, at index: AttributedString.Index)

Parameters

s

The string to insert.

index

The index that indicates where to insert the string.