AttributedTextFormatting.ValueConstraint
struct · iOS 26.0+ · SDK 27.1
struct ValueConstraint<Scope, AttributeKey> where Scope : AttributeScope, AttributeKey : AttributedStringKey, AttributeKey.Value : SendableA text formatting definition that constrains the value of a single attribute to the members of a set. struct MyTextFormattingDefinition: AttributedTextFormattingDefinition { var body: some AttributedTextFormattingDefinition< AttributeScopes.SwiftUIAttributes > { // Allow no underline or the `.single` underline style. If // a text has any other underline style, it is corrected // to the default value `.single` ValueConstraint( for: \.underlineStyle, values: [nil, .single], default: .single) } }
Members (0)
This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.
Skipped declarations
3 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
AttributedTextFormatting.ValueConstraint.init(for:values:default:)
This declaration needs Swift generic type arguments. (no canonical witness for Scope)
AttributedTextFormatting.ValueConstraint.init(for:values:default:)
Passing a Swift type itself is not supported.
AttributedTextFormatting.ValueConstraint.constrain(_:)
This declaration needs Swift generic type arguments. (no canonical witness for Self.Scope)