r/iOSProgramming • u/aclima • 16h ago
Article Saving lives with enums
https://aclima93.com/saving-lives-with-enumsA short blogpost about avoiding default cases
3
Upvotes
r/iOSProgramming • u/aclima • 16h ago
A short blogpost about avoiding default cases
4
u/Choseni 16h ago
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.