Home > OS >  Swift recognize tableView cell tap area
Swift recognize tableView cell tap area

Time:09-17

How can I detect a particular area tapped of a tableView cell porgrmatically?

For example, if the user taps the left half of the tableView Cell, didSelectRowAt is called and recognizes the left half of the cell.

Pseudo:

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {

    print("Entire cell tapped")

    if(left side of cell pressed){
      //cell.width /2
      print("left side half of cell pressed")
   }
}

CodePudding user response:

According to enter image description here

  • Related