I want to know when a user touched the screen of my application.
I have considered using - (UIResponder *) nextResponder , but unfortunately this will not work, as I also automatically reload the table, so it fires when this happens.
I also tried a gesture recognizer with the following code. But this only recognizes the touch of opinion. When I have many buttons, the user will use to control the application. I would like to avoid adding a gesture recognizer or code for this in each button and managing the segments that I have on the screen.
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapOnView:)];
[self.mainView addGestureRecognizer:tap];
- (void)tapOnView:(UITapGestureRecognizer *)sender
{
}
I also tried - (void) touchhesBegan: (NSSet *) concerns Event: (UIEvent *) event , but it has the same problem as gesture recognizer.
I was wondering if I can achieve this. I was hoping I could recognize the type of event from the next Responder, and then I could determine if this is a button, for example.
EDIT: The reason I am working on this is because my application must remain active and the screen cannot be locked (so I locked the screen lock). To avoid excessive use of power, I need to smooth the screen, but then return the brightness back to its original level as soon as the application touches. I need this function only for one of my view controllers.