macdriver icon indicating copy to clipboard operation
macdriver copied to clipboard

allow for custom protocol implementations to skip Has* methods

Open daaku opened this issue 7 months ago • 1 comments

Please consider this change carefully - I'm not so familiar with the implications.

In experimenting with implementing a protocol using a custom struct, I found that for optional methods, the HasXXX method was required. This change makes it such that if the method XXX is implemented, but the corresponding HasXXX is not implemented, the method/selector is considered to be implemented.

This came out of me exploring the tableview example. Here's a significantly simpler version of the example (albeit without the dynamically changing data) using a custom NSTableViewDataSource implementation:

https://gist.github.com/daaku/be2cd99b492cfc75ba1efe23ca56acd0

daaku avatar May 15 '25 18:05 daaku

Yeah, we inherited this design from a project that was absorbed and it always bugged me. I believe this is fine and I would really like this. Will leave this open for now to see if anybody else has input and also because I haven't had time to properly maintain/push forward lately. I usually work in bursts, but I'll be looking into this in the next burst.

I guess one thing people could do to help expedite is to try this branch and see that all the examples work, that their programs still work, etc and report back here.

progrium avatar May 16 '25 17:05 progrium