switch case is ...

SwiftPattern MatchingSentence 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?