I have a view overlayed to the iPhone's camera view. In this view I have some uibuttons that are displayed in positions depending of values from accelerometer/compass. I need to fire an event when the user touch up inside the view but he doesn't touch up inside the uibuttons, I mean, the opposite action of touch up inside the uibuttons. Anyone knows a kind to do this? Thanks!
Asked
Active
Viewed 4,185 times
2
3 Answers
1
If you implement the UIResponder touchesBegan:withEvent: method..
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
...on your view, you'll be able to tell when the user has pressed outside of the buttons.
See the UIResponder Class Reference for more information.

John Parker
- 54,048
- 11
- 129
- 129
0
you may e.g. assign one event handler (IBAction) to UiVeiw and its UIButtons and then compare sender parameter:
-(IBAction) viewClicked :(id) sender {
if (id == myView) ...
}

heximal
- 10,327
- 5
- 46
- 69
0
I tried your options but it doesn't work. The view that I tried to fire the event was in a TabBar item in a camera view, so I think the responders chain doesn't work with it.
Finally, I solved the problem doing the overlay view the first responder with:[viewOverlay.view becomeFirstResponder];

alberto garcia
- 35
- 1
- 8