[swift-evolution] [Idea] Expression to retrieve the Objective-C selector of a method
James Campbell
james at supmenow.com
Wed Dec 30 19:33:06 CST 2015
Good point. Not sure if that's replaceable via a protocol or if that Api is just not suited for swift.
There is a proposal somewhere to be able to reference swift methods via back ticks a sort of selector for swift so maybe in this case we would use that.
Sent from my iPhone
> On 30 Dec 2015, at 20:27, Tino Heth <2th at gmx.de> wrote:
>
>
>> I'm not as familiar with OS X but why is it vital there ?
>
>> Do you have an example of use ?
>
> If those questions are for me ;-):
> Afair (have to do iOS most of the time now), "Undo" is the most prominent example. You don't link those menu entries to a concrete object, but rather say "bind this to a selector whose name is…", and then the system can determine the actual target (there may be many controls which support undo).
> Additionally, before this can happen, the system has to determine wether an entry is enabled at all — you can't do this when you have only a simple closure.
>
> Best regards,
> Tino
More information about the swift-evolution
mailing list