0

I have a problem with a GLKViewController (subclass) used in a Storyboard: it refuses to handle tap events.

I added a Tap Gesture Recognizer to the GLKViewController (subclass) in the Storyboard and linked it to a 'tapDetected' method:

enter image description here

- (IBAction) tapDetected:(id)sender {
      NSLog(@"tap\n");
      [self.navigationController setNavigationBarHidden: ![self.navigationController isNavigationBarHidden]];
} // tapDetected

This exactly how I manage - successfully - the taps in other view controllers in the same Storyboard. Only the GLKViewController does not receive the event: neither the log nor the navigation bar are affected by the tap.

I searched for any specific need of GLKViewControllers but could not find any. Do you have any idea and/or suggestion?


It looks like if I add a touchesBegan method everything works ok. So the question is: what's the point of the gesture recognizer in the Storyboard?

Antonio Sesto
  • 2,868
  • 5
  • 33
  • 51

0 Answers0