I am implementing ECSlidingViewController
in my app. Everything works fine, when I hit the menu button (UIBar) the left menu slides. But pressing the menu button again does not bring back the current ViewController
.
It works in the sample app, but I cannot find that line of code that brings back the current controller.
Here is the code to show the menu:
- (IBAction)menuButtonTapped:(id)sender {
[self.slidingViewController anchorTopViewToRightAnimated:YES];
}
Now I am looked everywhere for the part of the code that can dismiss the left menu layout but could not find it. It must be burry somewhere...
Github project
How do you get back to the current View Controller by pressing the Menu UIBar
button ?
@Eric opened my eyes on what is performing that event. It seems like the UIPanGestureRecognizer
is the one responsible to redisplay the main screen, unfortunately I couldnt get it to work after implementing that deleguate.
- (UIPanGestureRecognizer *)dynamicTransitionPanGesture {
if (_dynamicTransitionPanGesture) return _dynamicTransitionPanGesture;
_dynamicTransitionPanGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self.transitions.dynamicTransition action:@selector(handlePanGesture:)];
return _dynamicTransitionPanGesture;
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…