Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selection not working #6

Open
sarayd opened this issue Mar 13, 2017 · 0 comments
Open

Selection not working #6

sarayd opened this issue Mar 13, 2017 · 0 comments

Comments

@sarayd
Copy link

sarayd commented Mar 13, 2017

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)
      }
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant