Question

I am having trouble with setting up a basic ECSlidingViewController project.

I am using storyboards to set up my layout, but for the life of me I cannot get the unwind segue to work. When control dragging to the green exit button, it won’t allow me to make a connection.

Additionally, I cannot figure out how to add the pan gesture to the top view controller.

The transition fun example is the closest to what I am looking for (in regards to nag button to reveal menu and swiping the topViewController to reveal, as well as reset the top view controller when it is tapped) but I am having trouble picking apart the code.

Any insight on how to accomplish this?

Was it helpful?

Solution

ChrisSamuelson is right about the unwind segue.

As for the pan gesture, you add it using UIView's addGestureRecognizer:.

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

You may need to add it to another view in the hierarchy, it depends on how your topViewController is setup and where you want the panning to be enabled.

To support swiping and tapping to reset the top view, make sure you configure sliding view controller like this

self.slidingViewController.topViewAnchoredGesture = ECSlidingViewControllerAnchoredGestureTapping | ECSlidingViewControllerAnchoredGesturePanning;

OTHER TIPS

In order for you to make a connection to the green exit button in a view controller higher in your view controller hierarchy you need to have a method with this signature:

- (IBAction)yourUnwindMethodName:(UIStoryboardSegue*)sender 

where yourUnwindMethodName could be anything you choose. This method will appear when you attempt to make the connection to the green exit button.

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