iOS 11: UITableView editActionsForRowAt overrides any result from editingStyleForRowAt

Originator:garvankeeley
Number:rdar://34006800 Date Originated:Aug 22, 2017
Status:Open Resolved:
Product:iOS + SDK Product Version:11
Classification: Reproducible:Always
 
Summary:
Returning a delete action from editActionsForRowAt  and a .none style for editingStyleForRowAt, the row will be incorrectly deletable. iOS 8,9,10 did not have this behaviour.

Steps to Reproduce:
Implement both functions:
override func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {
override func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCellEditingStyle 

Returning a delete action from editActionsForRowAt  and a .none style for editingStyleForRowAt.

Expected Results:
As per previous iOS, the editingStyleForRowAt returning .none should result in no delete action shown when swiping on a cell.

Observed Results:
Can swipe delete to show edit button on rows.

Version:
iOS 11 xcode9 beta 5

Notes
------
To reproduce: create a project in xcode of master-detail view controller type, and paste this code into MasterViewController.swift

override func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {
        let delete = UITableViewRowAction(style: UITableViewRowActionStyle.default, title: "Delete", handler: { (action, indexPath) in
        })
        return [delete]
}

override func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCellEditingStyle {
        return .none
}

Run the project and swipe delete on a cell. The '.none' type of editing style is ignored, and swipe shows the delete button on a cell.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!