true if, and only if, every sub-pattern within the parentheses successfully matches the corresponding element in the target tuple.
Syntax
Mechanics and Behavior
Arity and Type Matching The arity (number of elements) of the tuple pattern must exactly match the arity of the tuple being evaluated. The compiler enforces this strictly. Furthermore, the type of each sub-pattern must align with or be castable to the type of the corresponding tuple element.- Expression Patterns: Matching exact literal values or expressions.
- Wildcard Patterns (
_): Explicitly ignoring specific elements at a given index without binding them to memory. - Value-Binding Patterns (
let/var): Extracting elements into the local scope.
is or as) to constrain matches dynamically. These type-casting patterns can be applied to individual elements within the tuple pattern, or to the entire tuple structure as a whole.
Tired of Poor Swift Skills? Fix That With Deep Grasping!Learn More





