I recently converted a project to Swift 3 with Xcode 8.0, and I got an error in a function that I don't understand very well. In these lines:
extension HomeTableViewController : UITableViewDelegate { func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { } }
To fix this error, Xcode tells me to add @objc(tableView:commitEditingStyle:forRowAtIndexPath:) immediately before this method.

Well, this works, but I donβt understand why this is only required for this method.
Xcode does not require adding an @objc element in front of my tableView:heighForHeaderInSection , but I see no difference in the UITableViewDelegate between this method and tableView:commitEditingStyle:forRowAtIndexPath:
So, you know why this is necessary for the tableView:commitEditingStyle:forRowAtIndexPath ?
Thanks in advance! π
swift swift3
Toldy
source share