更新到夫特3后,收到错误在以下代码:夫特3个UITableViewDataSource选择
extension MyViewController: UITableViewDataSource {
//...
func tableView(_ tableView: UITableView,
heightForRowAt indexPath: IndexPath) -> CGFloat {
return someValue
}
}
Objective-C的方法 '的tableView:heightForRowAt:' 由方法 “的tableView(_提供:heightForRowAt :) '不要求的 选择器匹配(' 的tableView:heightForRowAtIndexPath:')
可以固定
@objc(tableView:heightForRowAtIndexPath:)
func tableView(_ tableView: UITableView,
heightForRowAt indexPath: IndexPath) -> CGFloat {
return someValue
}
任何人都可以解释Swift新版本中签名更改的动机吗?关于它的migration guide没有任何信息。
看到这个http://stackoverflow.com/questions/39416385/swift-3-objc-optional-protocol-method-not-called-in-subclass –