首页 > 解决方案 > 如何在滑动时使用 UITableView 执行 Segue?

问题描述

我正在尝试在我的 viewController 和 EditBrainDump 之间进行导航。唯一的问题是:如何使用 UITableView 执行 segue?

错误

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x7f940c526660> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key inputName.'

动作代码:

    let edit = UITableViewRowAction(style: .normal, title: "Edit") { (action, indexPath) in
        // share item at indexPath
        let itemId = self.brainList[indexPath.row].id
        self.performSegue(withIdentifier: "editbraind", sender: self)


        print(itemId)
    }

    edit.backgroundColor = UIColor.blue
    return [delete, edit]

}

标签: iosswiftuitableviewsegue

解决方案


推荐阅读