I think it's a bad idea because current model (with no optional methods) 
encourages decomposing protocols into smaller ones, thus discouraging partial 
functions and making our code safer and more predictable.

In my opinion, right now, if you really need an optional protocol method, 
consider adding a default implementation for it. You'd be surprised how often 
it's enough to satisfy the need for an optional method.


Regards,
Adrian Kashivskyy

> Wiadomość napisana przez Yuval Tal via swift-evolution 
> <swift-evolution@swift.org> w dniu 30.03.2016, o godz. 16:08:
> 
> Hi,
> 
> I find that optional protocol methods to be very useful. However, there is a 
> caveat -- it needs to be mapped to @objc. This puts a set of limitations, 
> such as: structures cannot be used as parameters as it does not map to 
> objective-c. What do you think about removing the requirement of using @objc 
> and allow to create optional methods without these limitations?
> 
> Thank you,
> 
> -Yuval
> _______________________________________________
> swift-evolution mailing list
> swift-evolution@swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to