本质上,通过下面的代码,我让用户选择任何特定行并显示另一个 ViewController。虽然在应用程序首次启动时这确实可以正常工作,但在按下并成功显示 ViewController 几次后,我通常必须按单元格 2 或 3 次才能显示 ViewController。
这与我的自定义 UITableViewCell 类有关吗?
以下是我在TableViewController
中使用的代码
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let portfolio = structure[indexPath.row]
let controller = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "scheduledDelivery")
}
}
最佳答案
didSelectRowAt
结束
tableView.deselectRow(at: indexPath, animated: false)
关于ios - UITableView Cell 只需点击几下即可呈现 View Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56777818/