In my project there is a grid of users. I made grid using collection view. When user taps on cell I need position or frame of selected cell. I have used touch event of view but it's not working in the case of collection view.
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
let touch = touches.first!
let location = touch.location(in: self.view)
print(location)
}
also this method works when you touch rest of UIView expect collectionView items.