A custom QLPreviewController or UIDocumentInteractionController that can capture touch events

Ok, so I'm trying to create a Document Viewer similar to this picture: enter image description here

Basically, what should happen when the screen is deleted anywhere, the top and bottom panels will appear. Click again and they will disappear.

I have subclassed QLPreviewControllerand managed to use the top navigation bar that already comes with QLPreviewController. It works great. Now I need the bottom panel to be displayed whenever the top panel is displayed. I can add UIToolbarto the bottom of the page, but I need to capture touch events so that I can hide / show the bottom panel. I can’t figure out how to make it work. I tried adding UITapGestureRecognizerto the subclass view QLPreviewControlleron my own, no luck. I also tried to create an overlay UIViewthat has UITapGestureRecognizer, but which prevented the user form from interacting with the document below.

Anyone have any ideas on how to do this? Thanks in advance!

+5
source share
2

, , UITapGestureRecognizer. ,

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer

. QLPreviewController UIGestureRecognizerDelegate viewWillAppear:

UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(documentTapped:)];
tapGesture.cancelsTouchesInView = NO;
tapGesture.delegate = self;
[self.view addGestureRecognizer:[tapGesture autorelease]];

:

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

, QLPreviewController - ,

+3

QLPreviewController,

-(void)contentWasTappedInPreviewContentController:(id)item {}

!

0

All Articles