根据XML返回,我不希望当前的segue在UIButton触摸上执行。
我知道我可以选择我想要执行的segue,但是如何使segue 而不是执行?或者至少不执行(任何可用的segues )
发布于 2012-12-11 22:32:03
Apple Developer文档有正确的方法来取消在StoryBoard中管理的segue:
- (BOOL)shouldPerformSegueWithIdentifier:(NSString *)identifier sender:(id)sender例如:
- (BOOL)shouldPerformSegueWithIdentifier:(NSString *)identifier sender:(id)sender {
if ([identifier isEqualToString:@"listPopover"]) {
if (self.listPopover == nil) {
// Allow the popover segue
return YES;
}
// Cancel the popover segue
return NO;
}
// Allow all other segues
return YES;
}发布于 2017-02-10 14:39:08
查看这个线程:https://stackoverflow.com/a/42161944/4791032
您可以在func tableView(_ tableView: UITableView, willSelectRowAt indexPath: IndexPath)中签入它
https://stackoverflow.com/questions/8993341
复制相似问题