title: How to make model class for dictionary inside array in swift?
body: <p>Here is my Json: </p>
  
  <pre><code>[ {
      "id": 6854,
      "name": "Laundry Iron",
      "images": [
        {
          "id": 6856,
          "src": "https://abcd.com/yzx/uploads/1750.jpg",
        }
      ], 
  
       } ]
  </code></pre>
  
  <p>how do we make model class for getting "images":["src": "String" ]?. I want to grab "src" I have tried doing like , but it is not working  :</p>
  
  <pre><code>class ProductModel {
  
      var title: String?
      var regularPrice: Int?
      var salePrice: Int?
      var productDescroption: String?
      var imageUrl: [ImageUrl]?
  
      init(productJsonL: NSDictionary) {
          self.title = productJsonL["name"] as? String
          self.regularPrice = productJsonL["regular_price"] as? Int
          self.salePrice = productJsonL["sale_price"] as? Int
          self.productDescroption = productJsonL["description"] as? String
           //The problem is here ........
         //self.imageUrl = productJsonL["images"]![0]!["src"] as? String
          self.imageUrl = ImageUrl(imageUrlJson: (productJsonL["images"]![0] as? NSDictionary)!)
  
      }
  }
  
  
  
  class ImageUrl {
  
      var source: String?
      init(imageUrlJson: NSDictionary) {
          self.source = imageUrlJson["src"] as? String
      }
  
  }
  </code></pre>
  
  <p>please correct me with the structure like I have done above so that i can append everything at once in an array ? Thank you in advance!!</p>