App Scheme-

As you can see from my App Scheme I have UITableView and inside UITableViewCells I have UICollectionView.
My question right now is how to get UITableView row when user taps on UICollectionViewCell?
I tried this but that doesn't work me:
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
collectionView.scrollToItem(at: indexPath, at: .centeredHorizontally, animated: true)
let main = ViewController()
if let tableViewcell = superview?.superview as? ExploreTableViewCell {
let indexPath = main.tableView.indexPath(for: tableViewcell)
print(indexPath)
}
}
