总结规律
想要dismiss几次,就用几次presentingViewController 然后调用dismiss,代码演示如下
连续2次dimss演示效果
swift 方法
presentingViewController?.presentingViewController?.dismiss(animated: true, completion: nil)
oc方法
[self.presentingViewController.presentingViewController dismissViewControllerAnimated:YES completion:nil];
连续dismiss3次效果
swift 代码
presentingViewController?.presentingViewController?.presentingViewController?.dismiss(animated: true, completion: nil)
oc代码
[self.presentingViewController.presentingViewController.presentingViewController dismissViewControllerAnimated:YES completion:nil];