Skip to content

Instance MethodFoundationEssentials

index(_:offsetByRuns:)

iOS 15.0+ iPadOS 15.0+ Mac Catalyst 15.0+ macOS 12.0+ tvOS 15.0+ watchOS 8.0+
Returns the position of the run offset a given number of runs from a given string index.
func index(_ i: AttributedString.Index, offsetByRuns distance: Int) -> AttributedString.Index

Parameters

i

The index of a position in the string.

distance

The number of runs to advance by.