How to get all swift enum cases as an array
If you require to have all the cases of a specific enumeration as an array then you can use CaseIterable. You need to write CaseIterable after enumeration name and swift will expose a property allCases which is collection of all enumeration cases