I have an UIView custom class (m, h, xib) with two buttons on it. This view should receive a touch if I tap on it, so I implemented a UITapGestureRecognizer:
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:customElementView action:@selector(customElementPressed:)];
[customElementView addGestureRecognizer:tapGesture];
[tapGesture release];
This view has even two buttons on it, each with an implemented IBAction on it at a touchUpInside action.
My problem is that the two button’s aren’t receiving the action, each time I tap on them, the UIView’s TapGesture method gets called. How can I “force” somehow these buttons to catch the tap?
Please use the search function before posting a new question.
Searching UITapGestureRecognizer and UIButton, would have given you the answer:
https://stackoverflow.com/a/3348532/312312
or you might wanna try this approach first:
https://stackoverflow.com/a/8891030/312312