I have a dictionary in Swift 4 declared as:
/* Not a compilable code, excuse for brevity as it is a long map */
let map: [String:[String]] = ["16:9" : Array1, "4:3" : Array2,...]
Then I invoke
let keys = Array(map.keys)
let first = keys.first!
Problem is order in keys is not the same as order in map. The first value returned is not "16:9" as a result. Why is it so and how to fix it? I need keys in the same order.
EDIT: As several comments point of, dictionary is unordered so I shouldn't rely on ordering. In that case, the question is what datatype should I use to accomplish my task?