-3

I have created a custom tableview and when i use to click on each row and in didselect i use to get row index value. But in custom row cell i have added one button on which alert will open with options. But when I use to click on button didselect method did not call. So please help me out with this . I want row index value when i use click on button.

In this image link you can see the UI. I have added three dot button so i want row index value when i use to click on that button

In this image link you can see the UI. I have added three dot button so i want row index value when i use to click on that button

This method giving me row value when i use to click on name and image , but when i use to click on button it doe snot give me row value.

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

    let data:DataViewController = self.storyboard!.instantiateViewController(withIdentifier: "dataviewcontroller") as! DataViewController

    let getdata =  files_dict[indexPath.row]!
  print(indexPath.row)
    data.urlsting = getdata
    self.navigationController?.pushViewController(data, animated: true)
}
Bindu Yadav
  • 5
  • 1
  • 3

1 Answers1

0

The button is a view. It has a superview which is the tableview cell (there may be several levels). Once you have the tableview cell, you can find its row index.

gnasher729
  • 51,477
  • 5
  • 75
  • 98