title: Switch statement for imported NS_OPTIONS (RawOptionSetType) in Swift?
body: <p>The switch statement in Swift is so much more expressive. I'm wondering if this might be possible:</p>
  
  <p>Lets look at UIViewAutoresizing for example. It's defined in Objective-C as follows:</p>
  
  <pre><code>typedef NS_OPTIONS(NSUInteger, UIViewAutoresizing) {
      UIViewAutoresizingNone                 = 0,
      UIViewAutoresizingFlexibleLeftMargin   = 1 &lt;&lt; 0,
      UIViewAutoresizingFlexibleWidth        = 1 &lt;&lt; 1,
      UIViewAutoresizingFlexibleRightMargin  = 1 &lt;&lt; 2,
      UIViewAutoresizingFlexibleTopMargin    = 1 &lt;&lt; 3,
      UIViewAutoresizingFlexibleHeight       = 1 &lt;&lt; 4,
      UIViewAutoresizingFlexibleBottomMargin = 1 &lt;&lt; 5
  };
  </code></pre>
  
  <p>I can use it in Swift like an enum:</p>
  
  <pre><code>let foo = UIViewAutoresizing([.FlexibleHeight, .FlexibleTopMargin])
  </code></pre>
  
  <p>Is it possible to use a switch statement instead of multiple if-statements?</p>
  
  <pre><code>if foo &amp; UIViewAutoresizing.FlexibleHeight != nil {
  
  }
  
  if foo &amp; UIViewAutoresizing.FlexibleWidth != nil {
  
  }
  
  if foo &amp; UIViewAutoresizing.FlexibleTopMargin != nil {
  
  }
  </code></pre>
  
  <p>Something like this pseudo code:</p>
  
  <pre><code>switch foo { // ** THIS IS PSEUDO CODE AND WILL NOT COMPILE **
  
  case &amp; .FlexibleHeight:
      println("height")
  
  case &amp; .FlexibleWidth:
      println("width")
  
  case &amp; .FlexibleTop:
      println("top")
  
  }
  </code></pre>