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 OptionSetType
s.
Yup, thanks for notifying me about this. OptionSetType
s would be much better than enum
s 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 enum
s instead of OptionSetType
s. I will check the rest of the code to see if there are any NS_OPTIONS
translated as enum
s are left behind.