After updating to Swift 3 I get error in following code:
extension MyViewController: UITableViewDataSource {
//...
func tableView(_ tableView: UITableView,
heightForRowAt indexPath: IndexPath) -> CGFloat {
return someValue
}
}
Objective-C method 'tableView:heightForRowAt:' provided by method 'tableView(_:heightForRowAt:)' does not match the requirement's selector ('tableView:heightForRowAtIndexPath:')
It can be fixed with
@objc(tableView:heightForRowAtIndexPath:)
func tableView(_ tableView: UITableView,
heightForRowAt indexPath: IndexPath) -> CGFloat {
return someValue
}
Could anyone explain motivation of signature changing in new version of Swift? There is no info in migration guide about it.