4

Currently I'm using a QLPreviewController in a navigation controller. (pushViewController)

To hide the navigationbar I use a UITapGestureRecognizer. The user can show/hide the navigation bar by a single touch (tap). This worked well in iOS5

- (void)viewWillAppear:(BOOL)animated {
   [super viewWillAppear:animated];

   UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapped:)];
   [tapRecognizer setNumberOfTapsRequired:1];
   [tapRecognizer setDelegate:self];
   [[self view] addGestureRecognizer:tapRecognizer];
   [tapRecognizer release];
}

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
    return YES;
}

- (void)tapped:(UIGestureRecognizer*)gestureRecognizer
{
    //hide -/- show navigation bar
    [[self navigationController] setNavigationBarHidden:![[[self navigationController] navigationBar] isHidden] animated:YES];
}

But in the released version of iOS 6 the taps are now completely ignored, so I can't hide my navigation bar anymore.

Reason why I want to hide the navigation bar?

If you open a .numbers document, the navigationbar hides the 'sheet-buttons' under the navigation bar.

Ty.

Jonathan
  • 480
  • 6
  • 9

1 Answers1

7

since ios 6 the QLPreviewController is actually a completely seperate app (seperate process and everything)

Apple uses XPC for that:

=> so when you push that, your whole app moves to the bg, including its window and gesture recognizers

Daij-Djan
  • 49,552
  • 17
  • 113
  • 135
  • I'm curious to know if there's a solution or workaround though – valheru Jan 15 '13 at 20:29
  • It is not true that "your whole apps moves to the bg, including its window and gesture recognizers". It is more like any touch events happening over the QLPreviewController are never seen by any part of your app, not even UIWindow. Your app is still running and can receive touch events if they don't happen inside the QLPreviewController. You can, for example, put a view on top of the QLPreviewController, and it will receive touch events. – honus Mar 05 '14 at 00:07
  • the QLPreviewController is a fullscreen thingy. you push it or present it modally... QUOTE from the docs: " a modally-presented (that is, full-screen) controller" – Daij-Djan Mar 05 '14 at 12:43
  • bg = not into the BackgroundMode but behin the new UIWindow that the Remote VC uses – Daij-Djan Mar 05 '14 at 12:43
  • please show a sample (ios6+) where this is not so ;) – Daij-Djan Mar 05 '14 at 12:44
  • Presenting a dialog modally does not create a new UIWindow. I'm not sure what your gesture recognizers moving to the bg means but if you put a view on top of the QLPreviewController and attach a gesture recognizer to it that gesture recognizer works. That view and your app continue to receive events. In addition, when you present something modally on an iPad it doesn't have to take up the full screen. – honus Apr 05 '14 at 03:33