Programming, Swift, Object Oriented, Objective C.
colorSpace; } DisplayCanvas; typedef struct PrintCanvas { int dpi; } PrintCanvas; typedef enum CanvasType { display = 0, print } CanvasType; typedef struct Canvas { union { DisplayCanvas display; PrintCanvas printer; } super; CanvasType type; } Canvas; This way we can simulate type(of:) and