title: How to access collectionView from a different class in Swift
body: <p>I subclassed CollectionViewCell were I add different labels, animations and buttons.</p>
  
  <p>I am trying to delete a cell and update the collectionView in one of my methods in this class(CollectionViewCell) but I'm unable to access collectionView from here since it was declared in another class/viewController.</p>
  
  <p><strong>My CollectionView Class:</strong></p>
  
  <pre><code>//this is how I have declared the collectionView.
  class FirstViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate {
  
  @IBOutlet weak var collectionView: UICollectionView!
  }
  </code></pre>
  
  <p><strong>My CollectionViewCell Class:</strong></p>
  
  <pre><code>//this is what I'm trying to achieve although I know it's incorrect.
  class CollectionViewCell: UICollectionViewCell {
  
  func handlePanGesture(recognizer: UIPanGestureRecognizer) {
  
   FirstViewController.collectionView.reloadData()//
  
    }
  </code></pre>