> Some ideas I was thinking about for optional protocol functions was you’d 
> declare it like this:
> 
> protocol UIGestureRecognizerDelegate {
>  optional func gestureRecognizerShouldBegin(gestureRecognizer: 
> UIGestureRecognizer) -> Bool = true
> }
> 
> If you put “optional” there, the compiler would auto-generate an empty 
> function in a protocol extension in your module as if you had specified one 
> yourself. If the function has a return value, you would be required to 
> specify the default return value in the protocol which provides automatic 
> documentation of the default, too.

REALLY digging this. Strong +1.

A.

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

Reply via email to