Assume i have the following code
var dictionary = [\"cat\": 2,\"dog\":4,\"snake\":8]; // mutable dictionary var keys = dictionary.keys var values = dictionary.
No, it is not guaranteed to be in the same order. From documentation:
Swift’s Dictionary type is an unordered collection. The order in which keys, values, and key-value pairs are retrieved when iterating over a dictionary is not specified.