title: How to set an Array<Object> inside a Dictionary<String, AnyObject> - Swift3
body: <p>I'm new in swift. I'm trying to add an Array to a specific key in my Dictionary. </p>
  
  <p>I have the following code:</p>
  
  <pre><code>var myArray : Array&lt;Links&gt; = []
  var myDict : Dictionary&lt;String, AnyObject&gt; = [:]
  
  myDict["links"] = myArray as AnyObject?  // I need help in this row, It does not work.
  </code></pre>
  
  <p>This is the Json structure I have in myDict and I'm trying to set: </p>
  
  <pre><code>id : "blabla"
  links: [
     0: {key1: "a", key2: "b", name: "c", link: "d"}
     1: {key1: "e", key2: "f", name: "j", link: "h"}
  ]
  </code></pre>
  
  <p>Please, consider I already have all the rest working properly. My only problem is how to add my array in the dictionary as commented in the code above.</p>
  
  <p>My JSON structure: </p>
  
  <p><img src="https://i.stack.imgur.com/QMVUQ.png" alt="enter image description here"></p>
  
  <p>I hope I could make myself clear enough. 
  Thank you.</p>