I am adding tap gesture recognizer in a table view like this.
# let tapGestureRecognizer = CustomTapGestureRecogniser(target: self, action: #selector(openMethod(tapGestureRecognizer:)))
tapGestureRecognizer.data = indexPath.row
cell.textField.isUserInteractionEnabled = true
cell.textField.addGestureRecognizer(tapGestureRecognizer)
But the whole textfield is clickable, I want this only on click of text
2
Answers
you can get it with this trick:
you can see the view in "debug view hierarchy"(3D view) when your UIViewController is rendered:
and via right click on the view and choose the "Reveal in debug navigator" you can see the view hierarchy:
an see the hierarchy of the views:
and after that you can get it
note that, in the update of iOS SDK it may change, you should check it if exist:
you can see the hierarchy of the views with PO(print object command) like as:
You could set your text as an attributed string with a link attribute.