title: parsing json into an array in swift 3
body: <p>I am new on swift and I am getting a json back from a request but I can not parse. I am trying to get the json info and create coordinates to use on mapkit with annotations as well</p>
  
  <p>Below is the json I get back</p>
  
  <pre><code>{
      coord =     [
                  {
              islocationactive = 1;
              latitude = "37.8037522";
              locationid = 1;
              locationsubtitle = Danville;
              locationtitle = "Schreiner's Home";
              longitude = "121.9871216";
          },
                  {
              islocationactive = 1;
              latitude = "37.8191921";
              locationid = 2;
              locationsubtitle = "Elementary School";
              locationtitle = Montair;
              longitude = "-122.0071005";
          },
                  {
              islocationactive = 1;
              latitude = "37.8186077";
              locationid = 3;
              locationsubtitle = "Americas Eats";
              locationtitle = "Chaus Restaurant";
              longitude = "-121.999046";
          },
                  {
              islocationactive = 1;
              latitude = "37.7789669";
              locationid = 4;
              locationsubtitle = "Cheer &amp; Dance";
              locationtitle = Valley;
              longitude = "-121.9829908";
          }
      ] }
  </code></pre>
  
  <p>and my code to try to parse is this</p>
  
  <pre><code> let task = URLSession.shared.dataTask(with: request as URLRequest){
              data, response, error in
  
              //exiting if there is some error
              if error != nil{
                  print("error is \(error)")
                  return;
              }
  
              //parsing the response
              do {
                  //converting resonse to NSDictionary
                  var teamJSON: NSDictionary!
  
                  teamJSON =  try JSONSerialization.jsonObject(with: data!, options: .mutableContainers) as? NSDictionary
                  print(teamJSON)
                  //getting the JSON array teams from the response
                  let liquidLocations: NSArray = teamJSON["coord"] as! NSArray
  
                  //looping through all the json objects in the array teams
                  for i in 0 ..&lt; liquidLocations.count{
  
                      //getting the data at each index
        //              let teamId:Int = liquidLocations[i]["locationid"] as! Int!
  
                  }
  
              } catch {
                  print(error)
              }
          }
          //executing the task
          task.resume()
  </code></pre>
  
  <p>but not that I try works. I want to get the latitude, longitude and create an annotationn on the map</p>
  
  <p>Thanks for the help</p>