title: Create specific Json in Swift 4
body: <p>I have to deliver some specific JSON to a webserver, but I'm very confused about how to use the correct arrays and dictionaries, so I can't get to my final result. I'm starting from this: </p>
  
  <pre><code>["entries": [
                "member" : [
                            "id" : key,
                            "name" : value
                            ],
                "timestamp" : "\(dateString)"
                ]
  ]
  </code></pre>
  
  <p>in the JSON file I have to send to the server I can only have 1 "entries" and several "member" with specific "id" and "name" and timestamp. I'm aware that I have to use dictionaries but can't get to this result. This is what I tried so fare: </p>
  
  <pre><code>var leden = [Int: String]()
  var jsonDict = [String: Any]()
  var dateString = Date()
  
  for (key, value) in leden{
  
          jsonDict["\(key)"] = ["member" : [
                                            "id" : key,
                                            "naam" : value
                                            ],
                                "timestamp" : "\(dateString)"
                               ]
      }
      jsonFinaal = ["entries": jsonDict]
  </code></pre>
  
  <p>this is as close as I could get, but good enough because the key in jsonDict should not be there, I added the "entries" in a second dictionary to make this a unique entry.</p>
  
  <p>Anyone who can do beter to help me to the solution? </p>