我有一个函数1,它正在调用函数2来获取一些值。函数2呈现loginview,并在登录成功后对服务执行一些查询。
在function2中,我想等到呈现的视图login视图被解除。我不想在loginview的contentviewcontroller回调中做
我正在尝试下面的代码,但是它立即向前移动,即使在模态呈现视图控制器后。
请建议我如何在下面的buttonPressed函数中等待viewController被驳回。
@implementation ViewController
- (IBAction)buttonPressed:(id)sender {
ViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"modelVC"];
controller.modalPresentationStyle = UIModalPresentationCurrentContext;
controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
controller.delete = self;
NSLog(@"before presentViewController");
[self presentViewController:controller animated:YES completion:nil];
NSLog(@"after presentViewController");
}
-谢谢,Manish。
[self dismissViewControllerAnimated:YES completion:^{
//Put ur Code,This is implemented first and then dismiss the view controller
}];
[self presentViewController:(UIViewController *) animated:YES completion:^{
}];