[swift2objc] Generate bindings for enums
enum CompassPoint {
case north
case south
case east
case west
}
Enums are a bit complicated in Swift. There are simple enums like this one, and also enums with associated values.
How does this play with the enum overhaul from earlier?
swift2objc is a separate tool from ffigen, so it's not directly related.
I think if a Swift enum is simple enough that we can represent it as an ObjC/C enum, then it will make its way through to the Dart bindings just like any other enum. For the more complicated enums, we'll be generating classes that emulate the enums, and those will be represented in the Dart bindings as classes.
Later, we might be able to plumb some custom metadata through this pipeline to tell ffigen that a particular ObjC class is actually a representation of a Swift enum, and generate a Dart enum to wrap it, since Dart enums have many of the same features as Swift enums. That's not something I'm planning to do atm though.