UIDropDown icon indicating copy to clipboard operation
UIDropDown copied to clipboard

Selection not working

Open sarayd opened this issue 7 years ago • 0 comments

When the UIDropDown is put with another custom class in a view controller, the selection (didSelectRowAt indexPath) fails to work. In the showTable() function, I added

  var tap = UITapGestureRecognizer(target: self, action: #selector(self.didTap))
        table.addGestureRecognizer(tap)

and added the following function:

func didTap(onTableView recognizer: UIGestureRecognizer) {
      var tapLocation: CGPoint = recognizer.location(in: table)
      var indexPath: IndexPath? = table.indexPathForRow(at: tapLocation)
      if indexPath != nil {
          //we are in a tableview cell, let the gesture be handled by the view
          recognizer.cancelsTouchesInView = false
          print(indexPath)
      }
  }

sarayd avatar Mar 13 '17 03:03 sarayd