How to combine Enums Flexibility with Switch Statement
Enums are great way to handle different state for a finite set. The option to pass associated values in enums cases add even more power to it. Enums are very flexible when it come to Swift as compared to other languages, we don’t have to provide value for each case of enum. Tying this with switch statement can be really useful to handle enums cases in a complete type-safe way. Here is the example
Originally published at https://www.shashankthakur.dev.