目前,我的TableView中有一个swipe操作,用于在相应的单元格上执行swipe的自定义操作。然而,我想要改变我必须拖动多远才能获得默认的触觉反馈,以指示swipe完成。另外,我想添加一个功能,如果操作没有完成,它会自动隐藏滑动操作,而不是留在屏幕上。到目前为止,我的代码如下:
override func tableView(_ tableView: UITableView, leadingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
let customRowAction = UIContextualAction(style: .normal, title: "Action") {(action, view, completed) -> Void in
//perform updates to data
completed(true)
}
let configuration = UISwipeActionsConfiguration(actions: [customRowAction])
return configuration
}
我想实现类似于Apollo reddit应用程序的效果。任何帮助都将不胜感激!
发布于 2019-02-17 10:44:17
内置的行刷卡机制的设计细节不是由你决定的。要么接受它们,要么根本不使用它们(从头开始编写你自己的刷卡机制)。
https://stackoverflow.com/questions/54729163
复制相似问题