0
votes

I have 3 UILabels in an IBOutletCollection that are connected to a Tap Gesture Recognizer. When I tap on any of the labels, the UITapGestureRecognizer* sender.view always contains the view of the first label in the collection.

Have I stumbled across a bug or am I doing something incorrect to determine which label was tapped?

BTW I made sure to enable interaction for all the labels in code (I read about an old IB bug), but this had no effect.

If I disconnect the first label from the gesture recognizer then the 2nd label is always in sender.view, etc.

1

1 Answers

2
votes

You will have to set 3 tap gestures for 3 labels. Do it programmatically. One gesture can work only for one view. Make 3 UITapGestureRecognizer with same @Selector and add them on each UILabel. And don't worry It is not any bug.