Instance MethodFoundationEssentials
index(_:offsetByUnicodeScalars:)
iOS 15.0+
iPadOS 15.0+
Mac Catalyst 15.0+
macOS 12.0+
tvOS 15.0+
watchOS 8.0+
Returns the position of the Unicode scalar offset a given distance, measured in Unicode scalars, from a given string index.
func index(_ i: AttributedString.Index, offsetByUnicodeScalars distance: Int) -> AttributedString.Index
Parameters
iThe index of a position in the string.
distanceThe number of Unicode scalars to advance by.