Wednesday 4 September 2019

iOS 13 beta UITableViewCell Child View Touch Selects Table View Cell

So I have a UITableView with a custom UITableViewCell which has its own custom child view.

enter image description here

In iOS 12, above custom child view could be touched, it would not select the whole Table View Cell.

In iOS 13 Beta, touching custom child view also highlights/selects the whole Table View Cell.

    final class myTableView: UITableViewController {
      .......
        override final func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
      {

        //Do things for table view cell selection

      }
      .......
    }


    final class CustomChildView : UIView {
     ........
      override final func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?)
      {
            super.touchesBegan(touches, with: event)
            //Do touch down things

      }
     ........
    }

Is there a way to cancel table view cell selection when the custom child is touched?



from iOS 13 beta UITableViewCell Child View Touch Selects Table View Cell

No comments:

Post a Comment