title: How to check bitfields (SCNetworkReachabilityFlags in particular) for flags in Swift?
body: <p>I have a <code>SCNetworkReachabilityFlags</code> variable and want to check it for particular values, e.g. if the network is reachable via WWAN.</p>
  
  <p>The <code>SCNetworkReachabilityFlags</code> type is a <code>typealias</code> for <code>UInt32</code> and the various options are defined as <code>Int</code> variables.</p>
  
  <p>Using Objective-C you could do the following:</p>
  
  <pre><code>if (flags &amp; kSCNetworkReachabilityFlagsIsWWAN) {
   // do stuff
  }
  </code></pre>
  
  <p>In Swift if I try this:</p>
  
  <pre><code>if reachabilityFlags &amp; kSCNetworkReachabilityFlagsIsWWAN {
   // do stuff
  }
  </code></pre>
  
  <p>you get a compiler error: <code>Could not find an overload for '&amp;' that accepts the supplied arguments</code>.</p>
  
  <p>I've read some other questions where the bitfield options where defined as a <code>RawOptionSet</code> struct. This hasn't been done in <code>SCNetworkReachability</code>.</p>
  
  <p>How to you check for flags in Swift?</p>