Q:

How to make an array string from enum member raw value in swift

I am new in programming and swift. I have an enum like this
enum City : String {
    case tokyo = "tokyo"
    case london = "london"
    case newYork = "new york"
}

Could I possibly get that city name to an array from enum raw value? I hope I can get something like this :
let city = ["tokyo","london","new york"]

A:

Something like this.
let cities = [City.tokyo, .london, .newYork]
let names = cities.map { $0.rawValue }
print(names) // ["tokyo", "london", "new york"]

To get all enum values as an array see this.  

