The switch statement in Swift is so much more expressive. I\'m wondering if this might be possible:
Lets look at UIViewAutoresizing for example. It\'s defined in Objecti
Another solution that I came up with is this:
let foo = /* .. your value to test .. */
let allCases = [UIViewAutoresizing.FlexibleHeight, UIViewAutoresizing.FlexibleWidth, UIViewAutoresizing.FlexibleTopMargin]
for oneCase in allCases {
switch oneCase & foo {
case UIViewAutoresizing.FlexibleHeight:
println("height")
case UIViewAutoresizing.FlexibleWidth:
println("width")
case UIViewAutoresizing.FlexibleTopMargin:
println("top")
default:
break
}
}