title: How to get indexPath when image inside cell tapped
body: <p>I would like to implement feature that if profileImage tapped in tableviewCell, segue to detailView. I add tapGesture but I still can't figure out how to get indexPath to pass data. 
  I tried like this but app will crash.</p>
  
  <pre><code>    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
  
          if segue.identifier == "detailSegue" {
              let next: DetailViewController = segue.destination as! DetailViewController
            // pattern1
   let indexPath = tableView.indexPath(for: sender as! CustomTableViewCell)
           // pattern2
          let indexPath = tableView.indexPathForSelectedRow! as NSIndexPath
  
              next.data = datas[indexPath.row]
          }
      }
  </code></pre>
  
  <p>How can I fix this? Thank you in advance!</p>