ios - How to go back to current View Controller? -


i implementing ecslidingviewcontroller in app. works fine, when hit menu button (uibar) left menu slides. pressing menu button again not bring current viewcontroller.

it works in sample app, cannot find line of code brings current controller.

here code show menu:

- (ibaction)menubuttontapped:(id)sender {     [self.slidingviewcontroller anchortopviewtorightanimated:yes]; } 

now looked everywhere part of code can dismiss left menu layout not find it. must burry somewhere...

github project

how current view controller pressing menu uibar button ?


@eric opened eyes on performing event. seems uipangesturerecognizer 1 responsible redisplay main screen, unfortunately couldnt work after implementing deleguate.

- (uipangesturerecognizer *)dynamictransitionpangesture {     if (_dynamictransitionpangesture) return _dynamictransitionpangesture;      _dynamictransitionpangesture = [[uipangesturerecognizer alloc] initwithtarget:self.transitions.dynamictransition action:@selector(handlepangesture:)];      return _dynamictransitionpangesture; } 

as @eric pointed out, uibar button displays menu.

if want dismiss menu on same ibaction need add more logic:

- (ibaction)menubuttontapped:(id)sender {    //chek current position    if([self.slidingviewcontroller currenttopviewposition]==2){       //show menu       [self.slidingviewcontroller anchortopviewtorightanimated:yes];    }else{       //dismiss menu       [self.slidingviewcontroller resettopviewanimated:yes];    } } 

Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -