テーブルの削除機能を実装する方法メモ。
func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) {
if editingStyle == .delete {
// 処理したい内容を追加
}
}
これだけで、UITableViewを右にスワイプすると削除のアクションが実装されます。
コメント