Programming, Swift, Object Oriented, Objective C.
{ print("width: \(canvas.width), height: \(canvas.height)") } let canvas = DisplayCanvas() draw(canvas) width: 320, height: 240 Same works in C. // Canvas.h extern void CanvasDraw(CanvasRef canvas); // Canvas.m void CanvasDraw(CanvasRef canvas) { printf("width: %d, height: %d\n", canvas->width,