[swift-evolution] [Accepted] SE-0064: Referencing the Objective-C selector of property getters and setters

Jacob Bandes-Storch jtbandes at gmail.com
Fri Apr 15 11:43:40 CDT 2016


http://apple.github.io/swift-internals/api-design-guidelines/

It's a matter of interpretation, but:

    "Prefer method and function names that make use sites form grammatical
English phrases."

Maybe I'm missing something, but I can't figure out how to read
#selector(setter: Person.name). My second suggestion reads clearly as "the
selector for setting Person.name".

Jacob

On Fri, Apr 15, 2016 at 5:03 AM, David Hart <david at hartbit.com> wrote:

> Why? What guideline are you referencing?
>
> On 15 Apr 2016, at 09:53, Jacob Bandes-Storch via swift-evolution <
> swift-evolution at swift.org> wrote:
>
> Was the syntax fully bikeshedded by the core team before acceptance?
> Perusing the API guidelines, one could also imagine:
>
>     #selector(setting: Person.name)
>     #selector(forSetting: Person.name)
>
>
> On Thu, Apr 14, 2016 at 3:58 PM, Douglas Gregor via swift-evolution <
> swift-evolution at swift.org> wrote:
>
>> Proposal link:
>> https://github.com/apple/swift-evolution/blob/master/proposals/0064-property-selectors.md
>>
>> Hello Swift Community,
>>
>> The review of SE-0064 "Referencing the Objective-C selector of property
>> getters and setters” ran from April 7...12, 2016. The proposal is
>> *accepted*. Feedback was light but positive, with many considering this
>> to effectively be an obviously-missing piece of the #selector proposal (
>> SE-0022
>> <https://github.com/apple/swift-evolution/blob/master/proposals/0022-objc-selectors.md>
>> ).
>>
>> We welcome an implementation of this proposal. I’ve filed a ticket at
>>
>> https://bugs.swift.org/browse/SR-1239
>>
>> to track the implementation.
>>
>> - Doug
>>
>>
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-evolution
>>
>>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160415/9ea34e3a/attachment.html>


More information about the swift-evolution mailing list