Core Graphics Longevity

The more I poke and prod at it (I’ve been doing quite a lot of that lately), the more impressed I am by the CGContext family of APIs.

Here we have a fairly concise set of functions that first shipped in OS X 10.0. They’ve been added to and tweaked over time, but those changes have been relatively small. You can fit most of the API in your head, or at least the rough shape of it all.

When iOS development first became available to us, there was CGContext, virtually unchanged, ready for us to use. And Core Animation across both platforms neatly takes the CG APIs to build a smart compositing engine upon them.

Sure, there are complaints to be made. The API is C, not Objective-C, and can’t really be extended. But that’s not surprising given the circumstances the time it was designed in, and it seems Swift helps improve on that quite a bit. And I have to admit I still often find bitmap handling outside of drawing-to-the-screen to be a bit cumbersome.

But still, it’s pretty darn impressive. Someone knew what they were doing.

© Mike Abdullah 2007-2015