I subclassed CollectionViewCell were I add different labels, animations and buttons.
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.
My CollectionView Class:
//this is how I have declared the collectionView.
class FirstViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate {
@IBOutlet weak var collectionView: UICollectionView!
}
My CollectionViewCell Class:
//this is what I'm trying to achieve although I know it's incorrect.
class CollectionViewCell: UICollectionViewCell {
func handlePanGesture(recognizer: UIPanGestureRecognizer) {
FirstViewController.collectionView.reloadData()//
}