I think that every now and then it’s a good idea to remind yourself how far along you’ve come in the pursuit of a skill or hobby. I decided to go digging through my code archives and try to find the earliest piece of Cocoa code I have. I came up with this little gem:

This is the first “real” Cocoa app I built. It’s a little kaleidoscope graphics toy that lets you play around with Bézier curves. Here’s a movie of it in action.
The best way to learn a new technology/programming language/development tool is to just get your hands dirty and write some code. This is a silly little app, but it taught me a lot:
- How to build custom views
- How to draw with Quartz, the 2D graphics API on Mac OS X
- How to capture and handle mouse events
- How to create a document-based app
- How to use Interface Builder to lay out my UI
I’m still amazed at how little code there is. Just a few files, each with a page or two worth of code. Now that I think about it, it was probably the simplicity and elegance of my initial experience with these APIs that got me hooked on Cocoa programming. Everything just sort of ‘clicked’ for me when I was writing the app.
If you’re interested, you can play around with it yourself. I’ll even give you the code:
- App. Intel only: FlowerGen.zip
- Source code: FlowerGen-Src.zip
Feel free to use the source however you like. If you make any fun modifications to it, please drop me a line.
The earliest source file is dated December 10, 2002. These were the Mac OS 10.2 Jaguar days. Back then, it was hard for me to imagine working somewhere where I could write Cocoa apps all day. Mac-only programming jobs were hard to come by.
Fast-forward almost 7 years. Now I spend all day writing nearly the same Cocoa code for a computer that fits in my pocket.
Crazy.