8

編集アクションを持つ UITableViewCell で左にスワイプするのと同等のことをプログラムでトリガーする方法はありますか? [tableView setEditing:YES animated:YES]これは、そのメソッドがテーブル全体を編集モードに設定し、単一の行の編集アクションではなく、挿入/削除左アクセサリ ビューおよび/または並べ替えコントロールを表示するという単純なものとは異なります。

4

1 に答える 1

-2

UITableViewDelegateoptional func tableView(_ tableView: UITableView, editingStyleForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCellEditingStyleから使用できます。スワイプしたいセルに戻ります。スワイプをトリガーしたいときにそのセルをリロードするために使用します。UITableViewCellEditingStyleDeletefunc reloadRowsAtIndexPaths(_ indexPaths: [NSIndexPath], withRowAnimation animation: UITableViewRowAnimation)

于 2016-03-19T15:13:53.227 に答える