[swift-evolution] [Idea] Expression to retrieve the Objective-C selector of a method

Tino Heth 2th at gmx.de
Wed Dec 30 14:27:45 CST 2015


> 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