3 ms·
True, but that's exactly the kind of change to the API required to make it more compile-safe. I still managed to crash this API by not providing a .rawValue som
by dep_b 9y ago
True, but that's exactly the kind of change to the API required to make it more compile-safe. I still managed to crash this API by not providing a .rawValue somewhere. I don't think applications need to crash on key-value errors.
An enum wouldn't be so bad if it also would use the associated value. Would make it impossible to set the wrong value at least.
- favorited 9y agoAhh right, NSUnderlineStyle... I totally thought that was improved in Swift 4, what a bummer. I have some unit tests in my apps that make sure I'm setting the .rawValue instead of the enum case itself, because that one does suck. I'm gonna file a bug.
- dep_b 9y agoYup that was exactly the one!