I don't mean to answer the question with a question, but would you ask the Swift team why they're so intent on UIKeyboardType
being an enum in Swift? I'm trying to understand why you're insisting on it not being an enum, because it sounds like what you consider to be poor advice should just as equally apply to every enum defined by Apple's Objective-C frameworks, right? Taking the above statement to its conclusion is saying that no enums from Foundation, UIKit, etc. should be imported into Swift as enums. But that's explicitly called out as a rejected alternative in the proposal (Import non-frozen C enums as RawRepresentable structs).
For the sake of argument, let's consider the ICU enum UWordBreakValues
, which has had cases added to it over time. I want to use that enum (or one equivalent to it) as the return type for a property in Swift's standard library. Then, let's consider UIKit's UIKeyboardType
, which has also had cases added to it over time. Can you explain why, if both of those C enums are exposed by a Swift library owned by Apple/the Swift team, they should be treated differently—one as an enum, and one not? I can't see why—either by your argument above, they should both be RawRepresentable
structs, or they should both be enums.