dimanche 27 mars 2016

How to get parameter value of enum in IF condition?

How do write this

switch parameter {
case .CaseA(let valueA):
   print(valueA)
}

as an If condition statement? This doesn't work:

if parameter == .CaseA(let valueA) {
   print(valueA)
}

Aucun commentaire:

Enregistrer un commentaire