Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Custom Segue with Button #88

brianramirez opened this Issue Feb 18, 2013 · 6 comments


None yet
5 participants

Is there a way with ECSlidingViewController to present one of the child view controllers when a UIButton is pressed from the Main View and NOT the sliding menu? Been trying to find a way to do it but no success.

nickgs commented Apr 28, 2013

I am in the same boat here. In scour mode looking for a solution. Any updates?


enriquez commented Apr 28, 2013

You can access the sliding view controller from the UIViewController category and set the topViewController to something else.

self.slidingViewController.topViewController = newChildViewController

@enriquez enriquez closed this Apr 28, 2013

bulut commented Jun 19, 2013

Is there a way to animate the transition to the newChildViewController? Thanks so much for your help.

I've been able to accomplish it with this code:

UIViewController *newTopViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"NewVC"];

[self.slidingViewController anchorTopViewOffScreenTo:ECRight animations:nil onComplete:^{
CGRect frame = self.slidingViewController.topViewController.view.frame;
self.slidingViewController.topViewController = newTopViewController;
self.slidingViewController.topViewController.view.frame = frame;
[self.slidingViewController resetTopView];

However, it's not very smooth. It slides the old top VC away nicely then the new top VC jumps in place. There's also an issue of "focus". I can't interact with any of the controls in the new VC until I tap on it somewhere (almost like I'm selecting it).

bulut commented Jun 19, 2013


Thanks so much for your quick response. Really appreciate the code snippet too. Because the action is initiated from the toolbar on the bottom of the screen, the user would expect a segue instead of a sliding view. It would be awesome, if I can use the segue to animate to the target VC in addition to using the left menu to slide view to the target VC. Any thoughts?

bulut commented Jun 20, 2013

Thanks Alex. This is great. Exactly what I was looking for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment