title: All Items From Array Not In UITableView
body: <p>Below is the CatalogViewController, which holds a tableview. The tableview has 1 prototype cell, ShopCell. When I print the items in the loop, they print correct, but when shown in the table, items are missing. 
  (Removing the shuffle() method does nothing &amp; removing removeDuplicates(), items appear more than once). I didn't include the addToFavorites(cell: ShopCell) because I'm testing it. It does nothing.</p>
  
  <pre><code>protocol ShopCellDelegate {
      func addToFavorites(cell: ShopCell)
  
  }
  
  class ShopCell: UITableViewCell {
  
      @IBOutlet weak var productImageView: UIImageView!
  
      @IBOutlet weak var titleLabel: UILabel!
  
      @IBOutlet weak var priceLabel: UILabel!
  
      @IBOutlet weak var descTV: UITextView!
  
      @IBOutlet weak var favoriteButton: UIButton!
  
      var delegate: ShopCellDelegate?
  
  
      override func prepareForReuse() {
         super.prepareForReuse()
  
          self.productImageView.image = nil
          self.titleLabel.text = ""
          self.priceLabel.text = ""
          self.descTV.text = ""
          self.favoriteButton.isHidden = true
  
      }
  
      func setProduct(product: Product) {
          productImageView.sd_setImage(with: URL(string: product.urlToImage!), placeholderImage: UIImage(named: "1024ELP.png"))
          titleLabel.text = product.itemName!
          priceLabel.text = product.priceTag!
          descTV.text = product.itemDesc!
      }
  
  
      @IBAction func favOrUnfav(_ sender: UIButton) {
          if let delegate = self.delegate {
              delegate.addToFavorites(cell: self)
          }
  
      }
  
  }
  </code></pre>
  
  <p>//</p>
  
  <pre><code>class CatelogViewController: UIViewController, GADInterstitialDelegate, SFSafariViewControllerDelegate, UITableViewDelegate, UITableViewDataSource, ShopCellDelegate {
  
  
      @IBOutlet weak var tableView: UITableView!
  
  
      static var shopType = String()
      static var linkToVisit = String()
  
      var myProducts = [Product]()
      var productKeys = [String]()
  
      var interstitial: GADInterstitial!
  
  
      override func viewWillAppear(_ animated: Bool) {
  
         visuals() // Sets Nav Bar color &amp; changes cell size if device == ipad
  
      }
  
  
      override func viewDidLoad() {
          super.viewDidLoad()
          self.tableView.delegate = self
          self.tableView.dataSource = self
          self.navigationController?.navigationBar.tintColor = UIColor.black
          if CatelogViewController.shopType == "Apparel" {
              self.title = NSLocalizedString("Shop Apparel", comment: "")
              fetchProductLinks(child1: "ProductList", child2: "Products")
  
          }else{
              self.title = NSLocalizedString("Shop Others", comment: "")
              fetchProductLinks(child1: "OtherList", child2: "OtherProducts")
              //shuffleItems()
          }
          if let index = self.tableView.indexPathForSelectedRow{
              self.tableView.deselectRow(at: index, animated: true)
          }
  
  
  
      }
  
  
      // MARK: - Table view data source
  
      func numberOfSections(in tableView: UITableView) -&gt; Int {
          return 1
      }
  
      func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          return myProducts.count
      }
  
  
      func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
          let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! ShopCell
          let product = myProducts[indexPath.row]
          cell.delegate = self
          cell.favoriteButton.isHidden = true
          cell.setProduct(product: product)
  
          return cell
      }
  
  
      func fetchProductLinks(child1: String, child2: String) {
  
          let ref = Database.database().reference()
          let prodRef = ref.child(child1).child(child2)
          prodRef.observeSingleEvent(of: .value, with: { snapshot in
  
              self.myProducts.removeAll()
  
              for items in snapshot.children {
                  let item = items as! DataSnapshot
                  let product = item.value as! [String : String]
                  let name = product["Name"]
                  let link = product["Link"]
                  let img = product["urlToImage"]
                  let desc = product["Description"]
                  let price = product["Price"]
                  let newProduct = Product(urlToImage: img, itemName: name, itemLink: link, itemDesc: desc, priceTag: price)
                  self.myProducts.append(newProduct)
                  DispatchQueue.main.async {
                      self.tableView.reloadData()
                  }
  
              }
  
  
              self.myProducts = self.shuffleArray(array: self.myProducts) as! [Product]
              self.myProducts = self.myProducts.removeDuplicates()
  
  
  
          })
  
          ref.removeAllObservers()
  
  
      }
  
  extension Array where Element:Equatable {
  func removeDuplicates() -&gt; [Element] {
      var result = [Element]()
  
      for value in self {
          if result.contains(value) == false {
              result.append(value)
          }
      }
  
      return result
  }
  </code></pre>
  
  <p>}</p>