Instance MethodSwift
isValid(within:)
iOS 26.0+
iPadOS 26.0+
Mac Catalyst 26.0+
macOS 26.0+
tvOS 26.0+
visionOS 26.0+
watchOS 26.0+
Indicates whether the range set is valid for use with the provided discontiguous attributed string.
func isValid(within text: DiscontiguousAttributedSubstring) -> Bool
Parameters
textA discontiguous attributed string used to validate the range set.
Return Value
true when the range set is valid for use with the provided discontiguous attributed string; otherwise, false. A range set is valid if each of its ranges are valid in the discontiguous attributed string.