isValid(within:)
Indicates whether the index is valid for use with the provided discontiguous attributed string.
Declaration
func isValid(within text: DiscontiguousAttributedSubstring) -> BoolParameters
- text:
A discontiguous attributed string used to validate the index.
Return Value
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.