I am having problems using strings in switch statements in Swift.
I have a dictionary called opts which is declared as
opts
Instead of the unsafe force unwrap.. I find it easier to test for the optional case:
switch opts["type"] { case "abc"?: println("Type is abc") case "def"?: println("Type is def") default: println("Type is something else") }
(See added ? to the case)