Finishing Words
Pattern Matching is a really powerful feature of Swift. It is one of the defining features that makes Swift Code so much nicer to read than what you'd write in Objective-C. It is also deeply integrated into the language as it can be used with let
, guard
, for
, if
, and switch
. It also allows adding where
clauses, using is
or as
for type casts, lets you extend it via ~=
and much more.