SWRevealViewController 回到之前 viewcontroller 不工作

SWRevealViewController back to previous viewcontroller not working

我正在使用 SWRevealViewController 并尝试实现后退按钮

这是我转到另一个视图的代码:

- (IBAction)goViewController:(id)sender {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UINavigationController *topViewController = [storyboard instantiateViewControllerWithIdentifier:@"globalFIndAutoCompleteID"];
[self.revealViewController pushFrontViewController:topViewController animated:YES];
}

和我的后退按钮代码:

  - (IBAction)backClick:(UIButton *)sender {
    [SVProgressHUD dismiss];

    [self.revealViewController.navigationController popViewControllerAnimated:YES];
}

我用以下代码替换了我的问题:

-(void) goViewController:(UIButton *)sender{
    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication]delegate];
appDelegate.previousController = self;

   UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
   UINavigationController *topViewController = [storyboard instantiateViewControllerWithIdentifier:@"globalFIndAutoCompleteID"];
  [self.revealViewController presentViewController:topViewController animated:YES completion:nil];
}


- (IBAction)backClick:(UIButton *)sender {
    [SVProgressHUD dismiss];
    [self dismissViewControllerAnimated:YES completion:^{}];
}