Tips for Getting Started with iOS

I’ve had quite a few developers ask me for tips on getting started with iOS. The following are the tips and resources I wish I knew about before starting my own journey with iOS.

iPhone

Keep in mind that in building an iPhone or iPad app there are 2 technologies you need to master:

  • iOS – the built-in libraries and API that you’re developing against (technically iOS is the operating system and Cocoa is the name for the libraries, but developers often just refer to both as iOS).
  • Objective-C – the language that you’re developing in. It’s an extension of C and is actually pretty dynamic. (You can also use Ruby for developing apps if you go the RubyMotion route – this is a commercial library that compiles Ruby code and targets the iOS operating system)

CodeSchool

If you’re just starting out with iOS I would highly recommend CodeSchool’s Try iOS course. You can try the first few lessons in the course for free, but for the full course you need to be a subscriber. In my opinion it’s definitely worth the cost. ($25 per month gets you access to all the courses). There is a similar course for Objective-C – you might want to complete this one before you do the iOS course, depending on your level of familiarity with Objective-C.

Stanford iOS Course

Stanford has an excellent iOS course and all the lectures are available via iTunes. The course is very thorough and will probably take you quite a while to get through, but at the end you will have a decent understanding of iOS. The first few lectures will even show you how to do use XCode properly.

If you’re like me you will probably want to jump in earlier and start writing code – I alternated between trying to write a small iPhone app and watching more of the videos.

Books

The Big Nerd Ranch Guide was recommended to me by various developers with iOS experience and it’s definitely a good resource. Be sure to get the latest version since iOS does change pretty substantially with every new release. (At the time of writing there was a 4th edition available for pre-order).

IDE

XCode Crashing

XCode is the standard IDE for iOS development. It has loads of weird issues (random crashes, for example) and a very strange user interface (none of the icons seem to represent anything, for example). There are some humorous views on this as well as some as well as some pretty reasonable explanations of the different pain points. Either way, most iOS developers use XCode.

JetBrains has developed an alternative called AppCode and some developers seem to absolutely love it. It doesn’t support Interface Builder, but it will automatically open nib or xib files in XCode.

I tried both and stuck with XCode in the end. (I did however install the plugin to use Vim bindings in XCode.)

If you’re new to iOS I would highly recommend that you familiarize yourself with the Instruments tool that comes packaged with XCode – this is invaluable for detecting and fixing memory leaks as well as monitoring CPU usage.

Package Managers

Ruby has RubyGems, .NET has Nuget, NodeJS has NPM, iOS has CocoaPods. CocoaPods itself comes packaged as a gem (which is actually really useful) and contains a number of very useful libraries. The most popular one is probably AFNetworking – a library for doing networking calls – but there are many others.

It’s definitely not as advanced as RubyGems and I’ve run into slightly weird issues with it, but it’s definitely the easiest way to integrate external libraries into your iOS projects. I would recommend you use Bundler to install CocoaPods – this way you ensure all developers are using the same version of CocoaPods.

Build Scripts

iOS has no built-in support for build scripts. I’m guessing that most developers build, test and package all from within XCode. Luckily it’s pretty straightforward to use Rake, especially if you’re using Bundler (which I recommend). I’ve used Rake to do compilation, testing and pushing to TestFlight – all via a CI server.

Gotchas

In terms of gotchas within iOS – there are plenty. Be really really REALLY careful of using blocks – if you don’t know exactly what you’re doing it’s really easy to leak memory like crazy. Also keep in mind that warnings in XCode pretty much always constitute an error on your part – pay attention to warnings and make sure you research them.

That’s all the advice I have! Happy coding.