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
switch. It also allows adding
where clauses, using
as for type casts, lets you extend it via
~= and much more.