isValid(within:)
Indicates whether the range 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 range.
Return Value
true when the range is valid for use with the provided discontiguous attributed string; otherwise, false. A range is valid if its lower and upper bounds are each either valid in the discontiguous attributed string or equivalent to the string’s endIndex.