title: Cannot convert value of type '(key: String, value: AnyObject)' to expected argument type '[String : AnyObject]'
body: <p>I'm trying to get to the <code>url</code> of <code>thumbnail_images</code> from the JSON response I got as shown in this picture below:
  <a href="https://i.stack.imgur.com/6UXDq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6UXDq.png" alt="enter image description here"></a>
  So in order to reach to the <code>url</code> I made a class called <code>Posts</code> in which</p>
  
  <pre><code>class Posts: NSObject {
  
      var title: String?
      var excerpt: String?
      var content: String?
      var thumbnail_images: [ThumbImages] = []
  
      init(dict: [String: AnyObject])
      {
          super.init()
  
          self.title = dict["title"] as? String
          self.excerpt = dict["excerpt"] as? String
          self.content = dict["content"] as? String
  
          if let postImage = dict["thumbnail_images"] as? [String: AnyObject] {
  
              for img in postImage  {
                  self.thumbnail_images.append(ThumbImages(dict: img))
              }
          }
      }
  }
  </code></pre>
  
  <p>On the line <code>self.thumbnail_images.append(ThumbImages(dict: img))</code> I get this error:</p>
  
  <blockquote>
    <p>Cannot convert value of type '(key: String, value: AnyObject)' to expected argument type '[String : AnyObject]'</p>
  </blockquote>
  
  <p>That is it for my questions but I think it's relevant to share more code as in order to reach to <code>url</code> I had to make to more classes <code>ThumbImages</code> and <code>MedLargeImage</code>. Which has the following code:</p>
  
  <pre><code>class ThumbImages: NSObject {
  
      var medium_large: [MedLargeImage] = []
  
      init(dict: [String: AnyObject]) {
  
          super.init()
  
          if let imgURL = dict["medium_large"] {
  
              for iURL in imgURL as! [AnyObject] {
                  medium_large.append(MedLargeImage(dict: iURL as! [String : AnyObject]))
              }
          }
      }
  </code></pre>
  
  <p>As you can see in the screenshot. So finally I'm in the room where I can get the URL:</p>
  
  <pre><code>class MedLargeImage: NSObject {
  
      var imageUrl: String?
  
      init(dict: [String: AnyObject]) {
  
          super.init()
          self.imageUrl = dict["url"] as? String
  
      }
  }
  </code></pre>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>If I change <code>if let postImage</code> in Posts class to:</p>
  
  <pre><code>if let postImage = dict["thumbnail_images"] as? [[String: AnyObject]] {
  
              for img in postImage  {
                  self.thumbnail_images.append(ThumbImages(dict: img))
              }
          }
  </code></pre>
  
  <p>The error is gone but for the if condition never gets true.</p>