【发布时间】:2020-03-22 23:30:48
【问题描述】:
【问题讨论】:
标签: ios swift eureka-forms uicontextualaction
【问题讨论】:
标签: ios swift eureka-forms uicontextualaction
您可以像下面这样简单地创建委托方法, trailingSwipeActionsConfigurationForRowAt 并根据需要对其进行自定义:
extension YOURVIEWCONROLLER: UITableViewDelegate{
func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
let removeAction = UIContextualAction(style: .destructive, title: "Remove") { action, view, complete in
//Your code
Utility.main.showAlert(message: "Removed Pressed", title: "Alert")
complete(true)
}
doneAction.backgroundColor = UIColor.red
return UISwipeActionsConfiguration(actions: [removeAction])
}
}
或者
在 Core.swift 文件中你需要编辑它的功能。
【讨论】: