我正在使用SWRevealViewController而我正在尝试实现后退按钮
我的代码转到另一个视图:
<html>
<body>
<div id="compA"></div>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="https://fb.me/react-0.14.7.js"></script>
<script src="https://fb.me/react-dom-0.14.7.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script>
<script src="comp.jsx" type="text/jsx"></script>
</body>
和我的后退代码:
- (IBAction)goViewController:(id)sender {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UINavigationController *topViewController = [storyboard instantiateViewControllerWithIdentifier:@"globalFIndAutoCompleteID"];
[self.revealViewController pushFrontViewController:topViewController animated:YES];
}
答案 0 :(得分:2)
我用以下代码解决了我的问题:
-(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:^{}];
}