title: How to get array key values from loop in Swift 3
body: <p>I'm updating my code from Swift 2.3 to Swift 3, and I am facing these difficulties to get an array key value from a loop in Swift:</p>
  
  <pre><code>var countryarray = NSMutableArray()
  
  self.GetCountriesResult = (responseJSON.objectForKey("GetCountriesResult") as? NSArray)!
  
  for i in 0 ..&lt; self.GetCountriesResult.count {
      self.countryarr = self.GetCountriesResult.objectAtIndex(i).objectForKey("countryname") as? String ?? ""
      self.countryarray.addObject(self.countryarr)
  }
  </code></pre>