I have this enum:
enum GestureDirection:UInt {
case Up = 1 << 0
case Down = 1 << 1
case Left = 1 << 2
case Right
You seems to want a bitwise support for your enums, but if you regards a translation of NS_OPTIONS
Objective-C in Swift, that's not represented by a Swift Enum but a struct
inherit from RawOptionSetType
.
If you need example or instructions, you can look at this NSHipster article
That's could be done with something like this :
struct UIViewAutoresizing : RawOptionSetType {
init(_ value: UInt)
var value: UInt
static var None: UIViewAutoresizing { get }
static var FlexibleLeftMargin: UIViewAutoresizing { get }
static var FlexibleWidth: UIViewAutoresizing { get }
static var FlexibleRightMargin: UIViewAutoresizing { get }
static var FlexibleTopMargin: UIViewAutoresizing { get }
static var FlexibleHeight: UIViewAutoresizing { get }
static var FlexibleBottomMargin: UIViewAutoresizing { get }
}
Regards,