# switch case is ...

[Swift](../..) ⟩ [Pattern Matching](..) ⟩ [Sentence Patterns]() ⟩

{% tabs %}
{% tab title="💈範例" %}
👉 比較： [if-let-...-as](if-let-...-as "mention"), [switch-case-let-...-as](switch-case-let-...-as "mention")

```swift
// switch on "protocol type"
switch medium {
  case is WebSite: // ⭐️ case is (without binding)
  default: // ...
}
```
{% endtab %}

{% tab title="📗 參考" %}
* AliSoftware ⟩ Pattern Matching&#x20;
  * [x] [Part 1: switch, enums & where clauses](https://alisoftware.github.io/swift/pattern-matching/2016/03/27/pattern-matching-1/)
  * [x] [Part 2: tuples, ranges & types](https://alisoftware.github.io/swift/pattern-matching/2016/03/30/pattern-matching-2/) ⭐️
{% endtab %}

{% tab title="👥 相關" %}
* [if-let-...-as](if-let-...-as "mention") - use <mark style="color:red;">**`as?`**</mark>.
* [switch-case-let-...-as](switch-case-let-...-as "mention") - optional binding.
{% endtab %}
{% endtabs %}
