Manuel Meyer
Jul 29, 2022

cocoa is written in objective-c, which has late binding and method dispatching as default. Using delegation has no real disadvantage there.

But in swift the protocol used in delegation acts like a type eraser — which forces dynamic dispatching, rather than swift's preferred way static dispatching.

(protocol-)delegation is fine for objective-c but inferior in Swift.

Manuel Meyer
Manuel Meyer

Written by Manuel Meyer

Freelance Software Developer and Code Strategist.

No responses yet