Ios 获取modal segue的sourceViewController
在Ios 获取modal segue的sourceViewController,ios,objective-c,segue,Ios,Objective C,Segue,在prereforsegue:之后,我是否可以获取模态序列的sourceViewController [UINavigationController] |-[ViewControllerA]-------\ |--(modal)--> [UINavigationController]-[ViewControllerC] [UINavigationController] | |-[ViewControllerB]---
prereforsegue:
之后,我是否可以获取模态序列的sourceViewController
[UINavigationController]
|-[ViewControllerA]-------\
|--(modal)--> [UINavigationController]-[ViewControllerC]
[UINavigationController] |
|-[ViewControllerB]-------/
完成ViewControllerC
后,我想执行sourceViewController
的展开顺序
我编写了以下代码,但它不起作用
if ([self.presentingViewController isKindOfClass:[ViewControllerA class]]) {
[self performSegueWithIdentifier:@"UnwindToViewControllerA" sender:self];
} else if ([self.presentingViewController isKindOfClass:[ViewControllerB class]]) {
[self performSegueWithIdentifier:@"UnwindToViewControllerB" sender:self];
}
有什么解决方案吗?尝试用
self.navigationController.presentingViewController
代替self.presentingViewController
“它不工作”没有多大帮助。你的代码给出了什么结果?您是否尝试记录self.presentingViewController?self.presentingViewController
是SWRevealViewController和self.navigationController.presentingViewController
nilIs ViewController-C是navigationController的实例,还是navigationController的rootViewController?