4

I want to make a view that is initially invisible on the left side of the screen. When the finger pan from the very left side of the screen, the left appears and follow the finger. I mean exactly like the Notification Center in iOS 5, but on the left side...

Here is a picture of what I want : https://i.stack.imgur.com/YLD5r.png

My problems is that there is a scrollview on the view underneath and the PanGestures are interfering...

I tried to catch touches in the underneath view only on a defined zone like this :

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {

UIViewController *touchedVC = (UIViewController *)[gestureRecognizer.view nextResponder];  

CGPoint point = [touch locationInView:touchedVC.view]

if (point.x < SIDE_VIEWS_HANDLE_SIZE)) {
    return YES;
}

I also used the delegate method

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

But still, I can't get all these pan gestures not to interfere with each other... Any idea please ? :-)

florion
  • 55
  • 4

2 Answers2

3

Checkout ECSlidingViewController. They have already done the heavily lifting for this type of view.

Steve Moser
  • 7,647
  • 5
  • 55
  • 94
0

I also had to subclass UIScrollView to catch its UIGestureRecognizer delegates.

florion
  • 55
  • 4