I'm given an NS_OPTIONS
defined in Objective-C:
typedef NS_OPTIONS(NSInteger, MyType) {
MyTypeOption1 = 1 << 0,
MyTypeOption2 = 1 << 1,
MyTypeOption3 = 1 << 2,
// etc
}
I'm importing this type into Swift, but I can't form bit fields.
let default : MyType = MyTypeOption1 | MyTypeOption2
The error:
Protocol 'BinaryInteger' requires that 'MyType' conform to 'BinaryInteger'
The IDE indicates that it is the standing-colon bitwise-or operator which is the problem.
Altering the NS_OPTIONS
declarations or declaring a new type with Swift's OptionSet
aren't ... options. How can I get Swift to play ball?