One Logo Pool Ball
Foundation · IOS API REFERENCE

AttributedString.Index

struct · iOS 15.0+ · SDK 27.1

struct Index

A type that represents the position of a character or code unit within an attributed string.

Members (1)

method · iOS 26.0+

isValid

TypeScript
isValid(text: DiscontiguousAttributedSubstring): boolean
Swift declaration
func isValid(within text: DiscontiguousAttributedSubstring) -> Bool

Indicates whether the index is valid for use with the provided discontiguous attributed string. - Parameter text: A discontiguous attributed string used to validate the index. - Returns: `true` when the index is valid for use with the provided discontiguous attributed string; otherwise, false. An index is valid if it is both within the bounds of the discontiguous attributed string and was produced from the provided string without any intermediate mutations.

Skipped declarations

2 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

AttributedString.Index.isValid(within:)

This parameter hides a concrete Swift type.

AttributedString.Index.init(_:within:)

This declaration needs Swift generic type arguments. (no canonical witness for S)

All Foundation types →