我有一个带有XIB文件的另一个视图控制器的弹出视图。它从父VC(detailViewController
)启动,但解雇代码在其自己的VC(KNThirdViewController
)
从(KNThirdViewController
)
- (IBAction)dismissButtonDidTouch:(id)sender {
[self dismissModalViewControllerAnimated:NO];
}
该应用返回rootViewController
而不是detailViewController
。它应该简单地解除它自己(KNThirdViewController
弹出VC)并将用户返回detailViewController
。
视图控制器显示为:
-(void)scriviBtnPress {
// You can also present a UIViewController with complex views in it
// and optionally containing an explicit dismiss button for semi modal
[self presentSemiViewController:semiVC withOptions:@{
KNSemiModalOptionKeys.pushParentBack : @(YES),
KNSemiModalOptionKeys.animationDuration : @(0.5),
KNSemiModalOptionKeys.shadowOpacity : @(0.3),
}];
}
答案 0 :(得分:3)
试试这样:
[self.presentingViewController.presentingViewController dismissViewControllerAnimated:YES completion:NULL];
答案 1 :(得分:0)
dismissModalViewControllerAnimated:
方法。为什么不尝试dismissViewControllerAnimated:completion: