unifiedh/Chameleon-Swift

Enums vs. OptionSetType

MaddTheSane opened this issue · 1 comments

At a cursory glance of UIView, it seems that some of the enums defined there, like UIViewAutoresizing, could be better served as OptionSetTypes.

Yup, thanks for notifying me about this. OptionSetTypes would be much better than enums in cases like UIViewAutoresizing, as they were initially defined as NS_OPTIONS with the original Objective-C code.
Although I migrated most of the Objective-C code to Swift myself, a small part of them was migrated with an automated code transpiler to save time. I thought I fixed most of the awkward code it produced. It seems the transpiler I used for this project translated Objective-C's NS_OPTIONS to enums instead of OptionSetTypes. I will check the rest of the code to see if there are any NS_OPTIONS translated as enums are left behind.