[swift-evolution] [Review] SE-0022: Referencing the Objective-C selector of a method

Joe Groff jgroff at apple.com
Thu Jan 21 18:14:11 CST 2016

> On Jan 21, 2016, at 11:08 AM, Douglas Gregor via swift-evolution <swift-evolution at swift.org> wrote:
>> On Jan 20, 2016, at 8:41 PM, Rob Mayoff via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> On Wed, Jan 20, 2016 at 9:39 PM, Chris Lattner via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> That said, I’m in favor of x.selector, or #selector(x).  The former seems more syntactically elegant if it is practical.
>> It seems like #selector(x) would make it easier to get good autocompletion (like Xcode's autocompletion of @selector(x) in ObjC doesn't insert argument placeholders).
> I guess we could give more targeted code completions inside #selector(<code complete here>, only providing name completions for @objc entities.

We don't necessarily need to limit it to @objc entities; we can theoretically instantiate an ObjC method and selector for any method (or context-free closure, even) with an ObjC-compatible signature on demand.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160121/a3c3b84d/attachment.html>

More information about the swift-evolution mailing list