Consider this code:
enum Type { case Foo(Int) case Bar(Int) var isBar: Bool { if case .Bar = self { return true } else {
Are you looking for the ? operator ?
?
documentation is here under the Ternary Conditional Operator title.