Question

I followed that tutorial to implement the basic setup of the ECSLidingViewController: http://www.youtube.com/watch?v=tJJMyzdB9uI

Now I want to change the transition of opening the leftView like the Default Example of the TransitionFun example.

I added the following code to the leftView:

UISwipeGestureRecognizer *rightRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(closeSettings)];
[rightRecognizer setDirection:UISwipeGestureRecognizerDirectionRight];
[self.slidingViewController.topViewController.view addGestureRecognizer:rightRecognizer];

Additionaly I added the line

[self.slidingViewController.topViewController.view addGestureRecognizer:self.slidingViewController.panGesture];

After the first start of the app, the topview is following my fingers while opening/closing. But after choosing one point of the leftview tableview, it's not working anymore.

In all my topViews, I have the following code in the viewDidLoad method:

UIScreenEdgePanGestureRecognizer *leftRecognizer = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(openSettings:)];
leftRecognizer.edges = UIRectEdgeLeft;
[self.view addGestureRecognizer:leftRecognizer];

Can anybody tell me what to change, that the behaviour of the first start is all the time?

Was it helpful?

Solution

sorry that was a stupid mistake: I forgot to add

[self.view addGestureRecognizer:self.slidingViewController.panGesture];

to each topViewController. Now it's working.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top