title: Swift dictionary ordering
body: <p>I have found an example of swift code and want to figure out: why item ordering is the same? If a dictionary stores associations between keys of the same type and values of the same type in an collection with <strong>no defined ordering</strong>.</p>
  
  <pre><code>import UIKit
  var rank:Dictionary = [1: "First", 2: "Second", 3: "Third" ]
  rank.updateValue("Fourth", forKey: 4)
  rank[5] = "Fifth"
  
  for i in rank {
      print(i)
  }
  
  print("\n")
  
  var rank2:Dictionary = [2: "Second", 1: "First", 3: "Third" ]
  rank2[5] = "Fifth"
  rank2.updateValue("Fourth", forKey: 4)
  
  
  for i in rank2 {
      print(i)
  }
  </code></pre>
  
  <p>so input is:</p>
  
  <pre><code>(5, "Fifth")
  (2, "Second")
  (3, "Third")
  (1, "First")
  (4, "Fourth")
  
  
  (5, "Fifth")
  (2, "Second")
  (3, "Third")
  (1, "First")
  (4, "Fourth")
  </code></pre>