> On Oct 21, 2014, at 13:13 , Greg Parker <[email protected]> wrote:
> 
> NS_ENUM or NS_OPTIONS is required for Swift to import it.
> 
> The name prefix is not required. If I recall correctly, the Swift importer 
> has some heuristics to omit any shared prefix from the Swift names, but if 
> there is no prefix then the enumerators are imported unchanged.

I guess I'm going to have to make a demo project to show that this isn't 
precisely true.

If I make a "plain" enum in C, Swift recognizes it for the purposes of creating 
a type, and for assignment. It will not, however, allow comparisons with those 
values.

If I use NS_ENUM without also prefixing each member with the enum's type name, 
Swift will not allow comparisons.

Only if I use NS_ENUM and prefix each member with the type name will Swift 
fully support the enum.

Honestly, though, I don't see why Swift can't just deal with "plain" enums.

-- 
Rick Mann
[email protected]



_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to