I have a UIViewController
like this:
class ViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.tableView.dataSource = self
self.tableView.delegate = self
}
}
extension ViewController: UITableViewDataSource {
// datasource methods...
}
extension ViewController: UITableViewDelegate {
func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
}
}
But I get this warning:
Instance method 'tableView(:canEditRowAt:)' nearly matches optional requirement 'tableView(:canFocusRowAt:)' of protocol 'UITableViewDelegate'
And I can't remove that warning.
How can I remove that warning?
I have to commit the Xcode project for the company I work without any warnings and I can't find how to suppress the warning.
The problem is that the tableView(_:canEditRowAt:)
method is from the UITableViewDataSource
protocol, not the UITableViewDelegate
protocol. Move it to the other extension.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With