switch case is ...
Swift ⟩ Pattern Matching ⟩ Sentence Patterns ⟩
👉 比較: if let ... as?, switch case let ... as
// switch on "protocol type"
switch medium {
case is WebSite: // ⭐️ case is (without binding)
default: // ...
}
Last updated
Was this helpful?