isValid(within:)
Indicates whether the index is valid for use with the provided attributed string.
Declaration
func isValid(within text: some AttributedStringProtocol) -> BoolParameters
- text:
An attributed string used to validate the index.
Return Value
true when the index is valid for use with the provided attributed string; otherwise, false. An index is valid if it is both within the bounds of the attributed string and was produced from the provided string without any intermediate mutations.