我已经成功解除了一个视图控制器,并提出了一个新的视图控制器,但新的视图控制器出现了一点延迟。如何消除延迟?我目前的代码是:
UIViewController * vcb=self.presentingViewController;
[self dismissViewControllerAnimated:YES completion:^{
UIStoryboard * storyBoard=[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
ContactsViewController * VC=[storyBoard instantiateViewControllerWithIdentifier:@"contactsView"];
[vcb presentViewController:VC animated:YES completion:nil];
}];
答案 0 :(得分:0)
你必须表明不需要动画过渡。将您的代码更改为...
UIViewController * vcb=self.presentingViewController;
[self dismissViewControllerAnimated:YES completion:^{
UIStoryboard * storyBoard=[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
ContactsViewController * VC=[storyBoard instantiateViewControllerWithIdentifier:@"contactsView"];
[vcb presentViewController:VC animated:NO completion:nil];
}];
如果你需要lees延迟试试这个......
UIViewController * vcb=self.presentingViewController;
[self dismissViewControllerAnimated:NO completion:^{
UIStoryboard * storyBoard=[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
ContactsViewController * VC=[storyBoard instantiateViewControllerWithIdentifier:@"contactsView"];
[vcb presentViewController:VC animated:NO completion:nil];
}];