Hello, community.

As I understood from documentation the only way to iterate multidimensional
array or a dictionary (with for loop) is this:

let multidimensionalDictionary = ["a":["b": "c"], "b":["c": "d"], "c":
["d": "e"]]
for (key, value) in multidimensionalDictionary {
    for (nestedKey, nestedValue) in value {
        print("\(key) -> \(nestedKey) -> \(nestedValue)")
    }
}

What do you think about this syntax?
for (key, nestedKey, nestedValue) in multidimensionalDictionary {
    print("\(key) -> \(nestedKey) -> \(nestedValue)")
}


--
I'm new to mailing list feature. If I do something wrong please let me know
about it.

Best regards,
Maxim
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to