title: Accessing Swift OptionSetType in Objective-C
body: <p>In my Swift class, I have an <code>OptionSetType</code> defined for fulfillment options.</p>
  <pre><code>struct FulfillmentOption : OptionSetType {
      let rawValue: Int
      
      static let Pickup = FulfillmentOption(rawValue: 1 &lt;&lt; 0)
      static let Shipping = FulfillmentOption(rawValue: 1 &lt;&lt; 1)
      static let UserShipping = FulfillmentOption(rawValue: 1 &lt;&lt; 2)
  }
  </code></pre>
  <p>I then create a variable to add/remove and read options. This works as expected.</p>
  <pre><code> var options: FulfillmentOption = []
   options.insert(FulfillmentOption.Pickup)
   options.contains(FulfillmentOption.Pickup)
  </code></pre>
  <p>However I need to access the <code>options</code> variable from one of my Objective-C classes. Since <code>OptionSetType</code> is not defined in Objective-C, the variable is not visible to any of my Objective-C classes.</p>
  <p>What is the best way for me to expose this to Objective-C? Should I stop using <code>OptionSetType</code> altogether?</p>
  <p>I've considered doing creating <code>public</code> and <code>private</code> variables like this to convert between the two. I don't love this, but it's the best I've come up with thus far.</p>
  <pre><code>private var _options: FulfillmentOptions = []
  private var options: UInt {
    get {
      // get raw value from _options
    }
    set {
      // set raw value to _options
    }
  }
  </code></pre>
  <p>Is there a more elegant way to accomplish this? I'd like to avoid writing unnecessary code.</p>