Question: I have added a subview to a View Controller's view. This subview is the view of QLPreviewController.

What I am trying to achieve is to recognize swipe gestures on the subview **in the parent view**, i.e. the View Controller's view. In the end, I want to be able to swipe left /right on the view to load the next document for preview.

I'm aware of hit testing and understand that by just attaching a gesture recognizer to the parent view, those will not be recognized, since the **subview** will be the "hit-test" view.

Now what is the best (or easiest) way to recognize those gestures?
Note: I didn't manage to attach the gesture recognizers to the subview, this doesn't seem to work.

**\* UPDATE \***

To make this more clear - this is the code from my ViewController. vContent is just a view in my ViewController, where I add the view of the QLPreviewController:

```
let pvVc = QLPreviewController()
pvVc.dataSource = self

vContent.addSubview(pvVc.view)

```

I tried adding the swipe recognizers both to the vContent and the pvVc.view. In both cases no event was fired.

```
let sgrLeft: UISwipeGestureRecognizer = UISwipeGestureRecognizer(target: self, action:Selector("handleSwipe:"))
sgrLeft.direction = UISwipeGestureRecognizerDirection.Left
sgrLeft.delegate = self

```

On some other view the code works fine.

Any hint is appreciated!
Thx
Eau

Answer: 
Well, the responder chain, the unknown animal … ;-)

You can subclass the superview and override `-hitTest:forEvent:`.

> 
> You rarely need to call this method yourself, but you might override it to hide touch events from subviews.
> 
> 
>
Gesture Recognizers Get the First Opportunity to Recognize a Touch, so even the subview is hitTest view. the gestureRecognizer attached on superView can recognizer touch event.