Here is the view structure:
The outer view is a UITableView
.
Inside the UITableViewCell
, there is a UICollectionView
You can override the point(inside:with:)
method of UICollectionView
and manually check whether any cell contains specified point:
class CollectionView: UICollectionView {
override func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
visibleCells.contains(where: { $0.frame.contains(point) })
}
}