On Teaching iOS Programming

I held my first course in iOS development for beginners last weekend and it was great. I had the privilege to introduce eight students with all kinds of different backgrounds to the iOS platform and SDK. All of them had programming experience in other languages and some had even worked through a few iOS programming tutorials before, though that was not required.

Over two days, we covered the basics of Objective-C, talked about pointers and memory management, and learned our way around Xcode 4. I introduced the Cocoa Touch frameworks and common design patterns like delegating and target-action and we spent a lot of time building view controllers and designing app flows around view controller hierarchies. After playing around with some cool iOS features like view animations and gesture recognizers, we used the beginning of day 2 to practice debugging with Xcode and Instruments.

We spent the rest of the day designing a more or less complete little app: I chose a basic RSS reader (called Feeder) for this because it lends itself nicely to a classic navigation controller design. It is also a great way to introduce talking with web services (through NSURLConnection) and local caching of the results (with Core Data). Everything together yields a fairly complex app that serves as a nice example to illustrate the code design of larger projects.

iPhones with screenshots of RSS reader app Feeder
Screenshots of Feeder, my little RSS reader sample app.

As I had expected beforehand, two days was not enough time to examine every aspect of Feeder in detail. At the end, I had to quickly go over some important concepts that I felt needed more explanation and practice. Still, I felt it important to not just work with countless small examples, thereby leaving the students in the dark on how to approach the design of a “real” app. Perhaps timing-wise it would have been better to move the harder stuff into the morning hours and leave the afternoon, when everyones’ heads are about to explode, for playing around and exploring the SDK, as one participant has suggested. Another alternative would be to extend the workshop to three days.

Anyway, I had a lot of fun teaching and I got some very good feedback from my students (thank you for that!), so if time permits, I will probably make this a more or less regular thing in the future. Not only because I enjoyed it so much but also because it is a great way for myself to learn. As the saying goes, if you really want to learn something, teach it to someone else. Highly recommended.

I will post some of the things I have prepared (and learned) for the course, including the source code of Feeder, here on my blog in the coming weeks.