UITableViewCellで、削除ボタンを出さなくした時のスペースを消す方法です。
内容
UITableViewでは以下のようなメソッドを実装する事で編集中に削除ボタンを出さない事ができます。
override func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCellEditingStyle { return .none }
しかし消すだけだと左側にスペースが残ってしまいます。
shouldIndentWhileEditingRowAt
を実装する事でスペースを消す事ができます。
override func tableView(_ tableView: UITableView, shouldIndentWhileEditingRowAt indexPath: IndexPath) -> Bool { return false }