You seem to have an assumption that a dictionary is ordered, it is not. See the Collection Types section of the Swift Programming Language Guide. What does this mean? It mean's that there is no guarantee that the values or keys are stored in the order you create them. The only guarantee you have is that accessing a value by it's key will return that value.
If you require your keys to be accessed in a given order it is up to you to provide that ability.
If you look at the Swift Standard Library Reference it documents what methods we can use on a dictionary.
You have the following properties and functions for working with indexes with dictionaries.
Properties:
startIndex
endIndex
Functions
func indexForKey(_ key: Key) -> DictionaryIndex<Key, Value>?
func removeAtIndex(_ index: DictionaryIndex<Key, Value>) -> (Key, Value)
Dictionaries also conform to the indexable protocol.
Collection Types
Swift provides three primary collection types, known
as arrays, sets, and dictionaries, for storing collections of values.
Arrays are ordered collections of values. Sets are unordered
collections of unique values. Dictionaries are unordered collections
of key-value associations.