Programming, Swift, Object Oriented, Objective C.
wikipedia We can implement dynamic dispatch using function pointers: // Canvas.c typedef struct Canvas { int width; int height; // Pointer to draw function implementation void (*draw)(struct Canvas *); } Canvas; // Draw function is exposed in .h and wraps function call void CanvasDraw(CanvasRef