I am a beginner in the swift programming language. I am having difficulty in understanding the order in which the labels in dictionaries are selected. For example in the code below :
let interestingNumbers = [
"Prime": [2, 3, 5, 7, 11, 13],
"Fibonacci": [1, 1, 2, 3, 5, 8],
"Square": [1, 4, 9, 16, 25],
]
var largest = 0
for (kind, numbers) in interestingNumbers {
print(kind)
for number in numbers {
if number > largest {
largest = number
}
}
}
output: Fibonacci Square Prime
So here it is clear that the dictionary is neither following the order in which I entered the stuff nor the alphabetic order. So my question is in what order are this labels are selected? and is there a way to force a particular order?