Skip to content
This repository has been archived by the owner on Jan 14, 2018. It is now read-only.

Enabling pan gesture even on underLeftViewController #98

Closed
dev-mush opened this issue Mar 11, 2013 · 7 comments
Closed

Enabling pan gesture even on underLeftViewController #98

dev-mush opened this issue Mar 11, 2013 · 7 comments

Comments

@dev-mush
Copy link

In facebook application (used as instance), if I pan the the controller that in our case we call topViewController to reveal the underLeftViewController I can bring the topViewController back even by sliding outside of him (which is in that case anchored), in other words even by swiping on the underLeftController.
I'd like to implement that mechanism, is this somehow possible?
I notice that if I assign the pan gesture to my underLeftController somehow it begins to work that way (even if with some gimmicks), but after I bring my topViewController back it has lost the pan gesture.
I thought that, by playing with notifications, I could assign and the assign the pan gesture to the right controller but it sounds tricky and not so clean, is there a better way I'm not noticing?

@itsaboutcode
Copy link

I have the same question - asked about the same time you asked and will really appreciate if someone can answer us this #97

@andrew-soltan
Copy link

In my MenuViewController, I added this line and it did the trick:

self.slidingViewController.shouldAllowUserInteractionsWhenAnchored = YES;

@ektayogesh
Copy link

It doesn't work for me, one thing that I would like to understand should I create a new instance of view controller every time you click on a menu item, can I create a singleton instance for each menu item view controller and every time user clicks on a menu item set the singleton instance of that view controller as the topViewController.

@utiko
Copy link

utiko commented Jun 28, 2013

You can save all viewControllers to array or dictionary on first call. And then only assign topViewVontroller to one of them on menu item click.

@ektayogesh
Copy link

Hello utiko, Yes that's what I am doing, but when I assign each of the viewController to topViewController first time they are ok but as soon as I assign them the second time I loose the panning gesture. One each of my controller viewDidLoad I am doing
[self.view addGestureRecognizer:self.slidingViewController.panGesture];

Some how I am suspecting that when I am re assigning one of the viewController to the topViewController, this panGesture is gtting messed up.

@ghost
Copy link

ghost commented Jul 4, 2013

I have tried the code suggested above by andrew-soltan
now I can pan the top view back but there are 2 new problems:

  1. tap gestures not working on the topview (so if I click the top right menu button it doesn't slide back)
  2. it's still not possible to swipe on the underLeftController.

here the StackOverFlow question: http://stackoverflow.com/questions/17453345/activate-pan-gesture-on-menucontroller-using-ecslidingviewcontroller

@enriquez
Copy link
Member

I was able to do this by adding a pan gesture to the menu view controller and setting it's target/action to the sliding view controller's pan gesture. See https://github.com/edgecase/ECSlidingViewController/tree/gh-98

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants