title: Array printing same results from API call
body: <p>I am building an app whereby you enter ingredients and you return a bunch of recipes based on your input. I'm making the calls to the API using alamofire and these seem to be successful. The problem I'm having is the 6 results in my test call are repeating 1 recipe 6 times rather than returning all the results in separate cells. This is the API call code:</p>
  
  <pre><code>import Alamofire
  
  class RecipeAp: NSObject{
  
  var concoctions = [RecipeDetails]()
  
  func provideRecipeDetailsForName(name: String, completed:@escaping ([RecipeDetails]) -&gt; Void) {
      let urlSearchString = URL_FULL + "onion" + "soup"
      Alamofire.request(urlSearchString).responseJSON(completionHandler: { response in
          let details = RecipeDetails()
          let result = response.result
          if let dict = result.value as? Dictionary&lt;String, AnyObject&gt; {
  
              if let matches = dict["matches"] as? [[String: Any]] {
                  for ingredient in matches {
                      if let name = ingredient["ingredients"] as? [String] {
                          details.ingredients = name
                          self.concoctions.append(details)
  
                      }
                  }
  
                  for recipeName in matches {
                      if let name = recipeName["recipeName"] as? String {
                          details.recipeTitle = name
                          print("the recipe name = \(name.debugDescription)")
                          self.concoctions.append(details)
  
                      }
  
                  }
  
              }
  
              completed(self.concoctions)
  
          }
  
  
  
      })
  
  }
  
  }
  </code></pre>
  
  <p><strong>This is my model:</strong></p>
  
  <pre><code>  class RecipeDetails: NSObject {
     var recipeID: String?
     var recipeImageURL: String?
     var recipeTitle: String?
     var recipeSourceURL: String?
     var recipePublisher: String?
     var ingredients: [String]?
  }
  </code></pre>
  
  <p><strong>This is my customCell setup</strong></p>
  
  <pre><code>   import UIKit
  
   class RecipeListCustomCell: UITableViewCell {
  
  
  @IBOutlet weak var recipeTitle: UILabel!
  @IBOutlet weak var recipeUrl: UILabel!
  
  var recipe: RecipeDetails? {
  
      didSet {
  
          updateView()
  
      }
  
  }
  
  func updateView() {
  
      recipeTitle.text = recipe?.recipeTitle
      recipeUrl.text = recipe?.recipeSourceURL
  
  
     }
  
   }
  </code></pre>
  
  <p><strong>And finally this is my viewController</strong></p>
  
  <pre><code> import UIKit
  
   class MainVC: UIViewController {
  
  @IBOutlet weak var tableView: UITableView!
  
  var recipe = RecipeAp()
  var results = [RecipeDetails]()
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      loadRecipes()
  
  }
  
  
       func loadRecipes() {
  
      recipe.provideRecipeDetailsForName(name: "onion" + "soup") { (response) in
  
          self.results = response
          self.tableView.reloadData()
  
      }
  
     }
  
   }
  
   extension MainVC: UITableViewDataSource {
  
   func tableView(_ tableView: UITableView, numberOfRowsInSection 
   section: Int) -&gt; Int {
      return results.count
  }
  
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: 
    IndexPath) -&gt; UITableViewCell {
  
      let cell = tableView.dequeueReusableCell(withIdentifier: 
      "RecipeListCustomCell", for: indexPath) as! RecipeListCustomCell
      let recipe = results[indexPath.row]
      cell.recipe = recipe
  
      return cell
  
  
     }
  
   }
  </code></pre>
  
  <p>Not sure how to display all the recipes separately in each cell. I have also attached some screen shots on what I am getting back from the API and the display in the simulator.</p>
  
  <p><img src="https://i.stack.imgur.com/kuaBq.png" alt="simulator output"></p>
  
  <p><img src="https://i.stack.imgur.com/pqSdy.png" alt="result back from Api"></p>