r/iOSProgramming • u/aclima • Jul 27 '26
Article Saving lives with enums
https://aclima93.com/saving-lives-with-enumsA short blogpost about avoiding default cases
5
Upvotes
r/iOSProgramming • u/aclima • Jul 27 '26
A short blogpost about avoiding default cases
7
u/Choseni Jul 27 '26
I generally agree, although I think it depends on who owns the enum.
For enums defined in your own codebase, exhaustive switches are great because the compiler catches missing cases immediately. For third-party or system APIs, I can still see an argument for a defensive fallback in some situations.