Open swift-ci opened 7 years ago
Comment by Alexander Shitikov (JIRA)
Very similar issue but without case with generics
Thanks for reporting. What happens if you explicitly mark the method @objc
?
Comment by Alexander Shitikov (JIRA)
If I mark it like this:
class CustomTableViewDelegate<T>: BaseTableViewDelegate<T> {
@objc func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print("Selected in subclass")
}
}
Nothing happens. Method doesn't call.
Ah, right, sorry. Last thing to check, how about if you provide the full selector?
@objc(tableView:didSelectRowAtIndexPath:)
Comment by Christopher Snazell (JIRA)
I just ran into this exact situation with XCode 13.1, Swift 5.5.1.
Prefixing an optional method implementation on the subclass with @obj or @objc(full selector) has no effect on the visibility of the method to UITableView when its looking at the delegate or data source.
Is there any ETA for when this might be fixed?
Cheers
Environment
Xcode Version 9.0 (9A235), Swift 4 (swiftlang-900.0.63 clang-900.0.37)Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 0431123cd21897ee0c5e7783f14807b0relates to:
Issue Description:
Say you have a base class of UITableViewDelegate - BaseTableViewDelegate and subclass CustomTableViewDelegate:
That case works perfectly. But if your BaseTableViewDelegate will have at least one generic parameter - BaseTableViewDelegate\<T> then didSelectRowAt method in subclass will not be called: