Given optionals and closures, is it necessary to support optional protocols?

protocol MyProtocol {
        var titleForRow:((_ indexPath:IndexPath)->(String))? { get }
}

One disadvantage is that you need Obj-C, which means it doesn’t run on linux, 
or several other platforms.
Another disadvantage, as I understand it, is it requires slower Obj-c dispatch, 
instead of witness tables.  Obj-C dispatch also only considers names, not 
argument & return types.

> On Nov 14, 2016, at 5:48 PM, Rick Mann via swift-evolution 
> <[email protected]> wrote:
> 
> Will Swift ever support optional methods without @objc?
> 
> What are the disadvantages of marking a protocol @objc?
> 
> Thanks!
> 
> -- 
> Rick Mann
> [email protected]
> 
> 
> _______________________________________________
> swift-evolution mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to