Re: Swift enums and NSNotificationCenter
Re: Swift enums and NSNotificationCenter
- Subject: Re: Swift enums and NSNotificationCenter
- From: Charles Srstka <email@hidden>
- Date: Wed, 05 Aug 2015 22:53:43 -0500
> On Aug 5, 2015, at 9:48 PM, Rick Mann <email@hidden> wrote:
>
>>
>> On Aug 5, 2015, at 17:40 , Charles Srstka <email@hidden <mailto:email@hidden>> wrote:
>>
>> On Aug 5, 2015, at 7:21 PM, Rick Mann <email@hidden <mailto:email@hidden>> wrote:
>>>
>>> Would it make sense for Swift to just let you add method implementations to protocols (perhaps as a shortcut to the protocol-extension technique you used)?
>>
>> That’s what a protocol extension *is*.
>
> No, I meant syntactically to the protocol. I'm not saying get rid of protocol extensions, but why not be able to also do this?
>
> protocol MyProtocol {
> func myFunc()
> {
> some stuff
> }
> }
>
> This should be equivalent to
>
> protocol MyProtocol {
> }
>
> extension MyProtocol {
> func myFunc()
> {
> some stuff
> }
> }
Ah, sorry I misunderstood. Yeah, this does seem to be a bit of a no-brainer.
Charles
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden