OrConstraint

public struct OrConstraint : Constraint

A constraint to check if at least one of the child constraints is valid or not.

  • An array of child constraints.

    Declaration

    Swift

    public let constraints: [Constraint]
  • See Constraint.

    Declaration

    Swift

    public let groups: Set<Group>
  • A validator named OrValidator to validate a value.

    Declaration

    Swift

    public let validator: ConstraintValidator
  • Initializes a new instance with an array of child constraints and a set of Groups to group by.

    Declaration

    Swift

    public init(_ constraints: [Constraint] = .init(), groups: Set<Group> = .init())

    Parameters

    constraints

    An array of child constraints.

    groups

    A set of Groups to group by. Defaults to an empty set.