I am positive that the following swift code has covered all possibilities, but Xcode keeps telling me that, \"Switch must be exhaustive, consider ad
In Swift, a switch statement must always provide an option for all possible cases. If you have an enum, you can add all enum values and the switch will be exhaustive. If it is not exhaustive, you need to add a default case, this will trigger when no other case is matched.
If you are switching on a variable, you should exhaust all cases. If you do that, a default case is not needed.
A programmer might be able to see that this switch is exhaustive, but the compiler does not. That is why you get the error, and you can fix it by adding a default case.