首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ios segue "cancel“

ios segue "cancel“
EN

Stack Overflow用户
提问于 2012-01-24 20:06:47
回答 2查看 9K关注 0票数 12

根据XML返回,我不希望当前的segue在UIButton触摸上执行。

我知道我可以选择我想要执行的segue,但是如何使segue 而不是执行?或者至少不执行(任何可用的segues )

EN

回答 2

Stack Overflow用户

发布于 2012-12-11 22:32:03

Apple Developer文档有正确的方法来取消在StoryBoard中管理的segue:

代码语言:javascript
复制
- (BOOL)shouldPerformSegueWithIdentifier:(NSString *)identifier sender:(id)sender

例如:

代码语言:javascript
复制
- (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;
}
票数 3
EN

Stack Overflow用户

发布于 2017-02-10 14:39:08

查看这个线程:https://stackoverflow.com/a/42161944/4791032

您可以在func tableView(_ tableView: UITableView, willSelectRowAt indexPath: IndexPath)中签入它

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8993341

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档