title: Reloading the collectionView after delete
body: <p>I'm using firebase. My code works but my issue is when I press the accept button, I want that index to be deleted from the collectionView and I want the table to reload right away right after. I can't use the slide to delete because I need it for another function.</p>
  
  <p><a href="https://i.stack.imgur.com/TFa0X.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TFa0X.png" alt="enter image description here"></a></p>
  
  <p>This is in my cell class thats why I did not use <code>self.</code> to call the collectionView. This function is being called by a <code>addTarget()</code> method. I'm thinking maybe passing an indexPath as a parameter, but I don't know how to pass an indexPath.item as a parameter and also how to pass a parameter inside an addTarget() method.</p>
  
  <pre><code>func handleAccept(_ sender: UIButton) {
          print("button pressed")
          guard let artId = art?.artId else {return}
          let approvedRef = 
      FIRDatabase.database().reference().child("approved_art")
          approvedRef.updateChildValues([artId: 1])
          let pendingRef = 
      FIRDatabase.database().reference().child("pending_art").child("\(artId)")
          pendingRef.removeValue { (error, ref) in
              if error != nil {
                  return
              }
              let layout = UICollectionViewFlowLayout()
              let pendingArtCollectionViewController = 
      PendingArtsCollectionViewController(collectionViewLayout: layout)
              DispatchQueue.main.async {
                  pendingArtCollectionViewController.collectionView?.reloadData()
              }
          }
      }
  </code></pre>