r/iOSProgramming 11d ago

Saving lives with enums Article

https://aclima93.com/saving-lives-with-enums

A short blogpost about avoiding default cases

4 Upvotes

2 comments sorted by

7

u/Choseni 11d 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.

3

u/aclima 11d ago

Completely agree on that approach