I have two files. First one is a UIViewController that contains a UICollectionView. Second one is a UICollectionViewCell that is something like a ViewController for the cell nib. It manages all actions inside the cell for example if the user clicks a like button inside a cell.
When the user clicks the like button I print the IndexPath of the cell that contains the like button. All cells contain a like button but I want to know the IndexPath of the cell where the user clicked the like button.
My Problem is how can I communicate this IndexPath to the UIViewController? I want to do it because my UIViewController stores the whole data (in an array) and I want to get access to specific part of this data using IndexPath. An other possibility is also to store this data inside the UICollectionViewCell file but it is not a good way.