title: Looping an array received from service
body: <p><strong>JSON from service</strong></p>
  
  <pre><code>{
      "firstname": "Utku",
      "lastname": "Dalmaz",
      "photos": [{
          "src": "image",
          "post_id": "69"
      }, {
          "src": "image",
          "post_id": "74"
      }, {
          "src": "image",
          "post_id": "133"
      }, {
          "src": "image",
          "post_id": "142"
      }]}
  </code></pre>
  
  <p><strong>SWIFT CODE</strong></p>
  
  <pre><code>Alamofire.request("SERVICE", method: .post, parameters: parameters).validate().responseJSON { response in
                  switch response.result {
                  case .success:
                      if let json = response.result.value {
                          var success = 0
                          if let dictJSON = json as? [String: AnyObject] {
                              if let successInteger = dictJSON["success"] as? Int {
                                  success = successInteger
                                  if success == 1
                                  {
                                      self.firstname = dictJSON["firstname"] as! String
                                      self.lastname = dictJSON["lastname"] as! String
  
                                      if let photos = dictJSON["photos"] as! Array&lt;String&gt; {
  
                                        let postID = //post_id data
                                        let src = //src data
  
                                        let data = InboxPhotos(ID: postID!, src: src!)
                                        self.photosArr.append(data)
                                      }  
                                     ...
  </code></pre>
  
  <p>I am trying to get array data from JSON service. Even though I am able to get firstname and lastname data, I cannot get and loop photos array in swift code.</p>
  
  <p>How can I loop photos array and get <strong>post_id</strong> and <strong>src</strong> data into <strong>InboxPhotos</strong> and append to photosArr array?</p>