swift - 让编辑按钮到我需要的地方
问题描述
我一直在尝试获取 FreshReleaseTableViewController 上的编辑按钮,以简单地将用户带回 AddFreshReleaseViewController。
任何建议,将不胜感激。
以下是我拥有的编辑按钮代码:
@available(iOS 11.0, *)
override func tableView(_ tableView: UITableView, leadingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
let modifyAction = UIContextualAction(style: .normal, title: "Update", handler: { (ac:UIContextualAction, view:UIView, success:(Bool) -> Void) in
print("Update action ...")
success(true)
})
modifyAction.title = "Edit"
modifyAction.backgroundColor = .blue
return UISwipeActionsConfiguration(actions: [modifyAction])
}
解决方案
推荐阅读
- azure - PowerShell:绑定资源组中的现有证书
- javascript - javascript中的问号后跟句号是什么意思?
- javascript - 如何使用基于两个集合文档的云函数触发器
- tsql - 无法通过 Max date 获得结果
- c - 我自己实现的 linux tail 函数输出错误
- flutter - Flutter - 未处理的异常
- python - 如何在 Pandas 数据框列中显示小数点后 2 位的值?
- windows - 在 Travis CI Windows 上使用 MSVC 和 cmake
- c++ - 将函数返回用于另一个模板函数 C++
- xml - 应用模板顺序如何影响父节点上的属性?