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