title: Retrieve dictionary from dictionary swift
body: <p>I am converting objective c code in swift.</p>
  
  <p>I am getting data from server which has a dictionaries in a dictionaries.
  i am  getting key value string but cannot get dictionary.</p>
  
  <p>example data:</p>
  
  <pre><code>data =         {
              caption = hello;
              image =             {
                  a = "https://www.google.com/1024x1024";
                  b = "https://www.google.com/640x640";
                  c = "https://www.google.com/480x480";
                  d = "https://www.google.com/";
  
              };
          };
  </code></pre>
  
  <p>i can get caption  </p>
  
  <pre><code>let dataDict = (mainDict[data] as? Dictionary&lt;String,AnyObject&gt;)!
  
  Obj.caption=String(dataDict["caption"]!)  //getting hello
  
  Obj.imageDictionary = (dataDict["image"] as? Dictionary&lt;String,String&gt;)! //getting 0 key value pairs
  </code></pre>
  
  <p>initialised imageDictionary  as</p>
  
  <pre><code>var imageDictionary = Dictionary&lt;String, String&gt;()
  </code></pre>
  
  <p>please suggest how to get the image dictionary, I want this dictionary to store in imageDictionary object.</p>
  
  <p>Any suggestions would be highly appreciated!
  Thanks in advance!</p>