Programming, Swift, Object Oriented, Objective C.
(*draw)(struct Canvas *canvas); } CanvasVTable; typedef struct DisplayCanvasVTable { void (*draw)(struct DisplayCanvas *canvas); } DisplayCanvasVTable; const CanvasVTable kCanvasVTable = { _CanvasDraw }; const DisplayCanvasVTable kDisplayCanvasVTable = { _DisplayCanvasDraw }; We define two virtual