title: Swift - Stored values order is completely changed in Dictionary
body: <p>I tried to display datas which is in Dictionary format. Below, three attempts are there. First attempt, output order is completely changed. Second attempt, output order is same as input. But, in third attempt, I declared variable as NSDictionary. Exact output I received. Why this changes in Dictionary? Kindly guide me. I searched for Swift's Dictionary tag. But I couldn't found out.</p>
  
  <pre><code>//First Attempt
  var dict : Dictionary = ["name1" : "Loy", "name2" : "Roy"]
          println(dict)
  
  //output:
  [name2: Roy, name1: Loy]
  
  //Second Attempt
  var dict : Dictionary = ["name2" : "Loy", "name1" : "Roy"]
          println(dict)
  
  //output:
  [name2: Loy, name1: Roy]
  -----------------------------------------------------------
  
  //Third Attempt With NSDictionary
  var dict : NSDictionary = ["name1" : "Loy", "name2" : "Roy"]
              println(dict)
  
  //output:
  {
      name1 = Loy;
      name2 = Roy;
  }
  </code></pre>
  
  <p>ANOTHER QUERY: I have used play ground to verify. My screen shot is below:</p>
  
  <p><img src="https://i.stack.imgur.com/sScqr.png" alt="play_ground_screen_shot"></p>
  
  <p>Here, In NSDictionary, I gave name5 as first, but in right side name2 is displaying, then, in println, it is displaying in ascending order. Why this is happening??</p>
  
  <p><img src="https://i.stack.imgur.com/eiBEu.png" alt="play_ground_screen_shot_2"></p>
  
  <p>Here, In Dictionary, I gave name5 as first, but in right side name2 is displaying, then, in println, it is displaying, how it is taken on the Dictionary line. Why this is happening??</p>