Shipping a first iOS app
August 27, 2012
My first iOS app, WALT, went live recently, and I wanted to share some of my thoughts on the development experience. Overall, there were two big differences from past projects I have worked on.
First, since most of my past Cocoa development has been focused on the Mac, building and shipping an iOS app meant learning a new app framework and some new ways of going about things. It has been an enjoyable, but odd, combination of exploring things which are a good deal different, yet simultaneously very familiar—like walking into someone else’s kitchen for the first time, but already knowing where they keep most everything.
Second, shipping an app as an independent developer is a very different experience than shipping a product as part of a large team at Apple. Intellectually, I knew this from the start. Even so, knowing about it doesn’t necessarily prepare you for all of the implications until you’ve lived through them.
One implication, of course, is that I was able to build the app I wanted to create. I had a few specific goals for a first app:
- Create an app that I wanted to use
- Focus on frameworks and fundamentals
- Build a solid, speedy, polished app
- Ship it
Create an app that I wanted to use
Since childhood I’ve been a fan of Disney (and later Pixar) animation as an audience member—suspending disbelief and just enjoying the experience. Over time, I’ve increasingly come to appreciate the incredible amount of artistry, collaboration and process that goes into each film.
One source of this growing appreciation is The Walt Disney Family Museum in San Francisco, which describes the evolution of animation as part of its narrative. I’m inspired by things such as the incredible advancements and innovations in animation from the late 1920s to the late 1930s. Over a ten year period, animated films progressed from being black and white series of sight gags using ‘rubber hose’ animations to lush multi-plane technicolor films with animated characters conveying personality and eliciting emotion.
I’m also inspired by the work of Pixar—and am amazed at the analogous progress of 3D animation from the mid-80s to the mid-90s.
Together, Disney and Pixar have produced over 640 animated shorts and features. With almost all films released on disc, I wanted to keep track of what I had seen. I also wanted a quick, mobile reference with some basic information on each film. And so, I built WALT so I could use it, and hopefully other Disney and Pixar animation fans would enjoy using it as well.
Focus on framework and fundamentals
The features of my desired app lined up nicely with the core functionality common in most iOS apps: present a set of data, navigate, search, sort, filter, summarize.
Since this first app is relatively straightforward, I wanted to take the stock iOS frameworks out for a spin and see just how far they would take me, and how quickly.
My past experience in working with Cocoa frameworks is that it is good practice to use the highest level of abstraction that meets your needs. On the flip side, it can be treacherous to try to force a framework to be something that it isn’t. If you must twist the higher abstraction into a pretzel knot of ugly bad practices to meet your needs, it’s usually best to drop to a lower layer and implement what you need (and, of course, file enhancement requests so that a future release might meet your needs).
In the spirit of using the highest level of abstraction available, WALT uses standard UIKit controllers and views, with a handful of custom views. The app hits just about all of the UIKit highlights: tabs, navigation, tables, custom table cells, search results, modal view controllers.
For data management, WALT uses Core Data. A key consideration in this choice was the ability to do incremental fetches and updates. It had also been a while since I had done Core Data development on the Mac, so it was a good opportunity to reacquaint myself.
I tend to exercise caution when adopting version 1.0 technologies and frameworks – especially if an app will be immediately pushing the limits of the new technology. In WALT, I adopted two relatively new technologies: Storyboards and Automatic Reference Counting (ARC).
Since I planned to support iOS 5.0 and later, the straightforward layout of the app made Storyboards seem to be a very good fit. The Storyboard abstraction seemed useful and held promise to simplify development and eliminate code. In the end, I encountered a severe accessibility bug which required much of the eliminated code to be added back in one form or another. Overall using Storyboards was a slight net win for the project, but the experience definitely reinforced my attitude of caution.
I had no intention of moving to ARC, but a few conversations with former Apple colleagues led me to give it a try on a development branch. It went without a hitch. My project was in an early stage, so there was not much code to convert, and I did not anticipate writing much code that would hit known ARC ‘sore spots’, such as frequent conversions between Core Foundation and Cocoa. So, I merged the ARC changes into my main development branch and have not regretted doing so at all.
Finally, I was able to add a bit of social media support in WALT very quickly. The Twitter framework in iOS 5 made it trivial to add support for tweeting about films you have watched.
Build a solid, speedy, polished app
These three, of course, should be goals of any app since they map to quality, performance, and user experience. They can also be somewhat subjective areas – how responsive is responsive enough? How polished is polished enough? In these areas, I set some specific goals and worked towards them.
First, for me, solid means not crashing, not losing data and not leaking memory. I don’t have enough programmer hubris to claim there are no bugs in the app, but hours of use without an issue made the app feel pretty solid to me and my testers. Instruments came in handy to check for leaks—ARC seemed to live up to its promise. I also periodically ran the Xcode static analyzer, which is excellent at catching potential problems.
Being speedy meant focusing on app launch, scrolling, navigating and searching. I focused on how responsive the app felt to the user rather than using timed code benchmarks. The criteria were that the app should launch within a count of ‘One-Mississippi Two-Mississippi’; scrolling should not lag—even in longer lists; navigation should be smooth and search results should feel immediate.
I did hit some scrolling performance issues and found Instruments to be a valuable tool in tracking down the problems. Most turned out to be cases where I was unnecessarily fetching data repeatedly, which the Core Data instruments made very obvious. In the end, the app feels snappy.
Making an app ‘polished’ is perhaps the most subjective and all-encompassing—it includes everything from user interaction, to the look of the app; from providing retina graphics, to how the app behaves for VoiceOver users. Since I was already on the road of seeing just how far the stock frameworks would take me, much of the app polish is provided by the frameworks themselves.
But even leveraging what the frameworks have to offer, there are lots of subtle things that make an app feel better. WALT contains touches like adjusting the display of a table index and sections depending on the contents of a list, restoring the user’s previous navigation and scrolling state if the app is terminated, and minor but important things like making the tap target size on a checkbox larger than its graphic.
Polishing the app was a process of using the app as I developed it, refining the behavior as the app evolved. With polish, often the code you end up writing is not particularly difficult or time-consuming, the bulk of the work is in determining exactly how an app should behave.
When working on a large project like OS X, someone else sets the schedule and decides that the product is ready to ship. As an independent, those decisions are yours, but so is the responsibility for those decisions.
I found one of the keys to shipping was to guard against feature creep by choosing a core set of features for version 1.0 and focusing on them. The process was fairly lightweight. First, record every issue, enhancement and feature idea. Then, decide which items absolutely need to be in the 1.0 milestone and move the rest to a Later milestone.
The lists were not immutable. As work progressed, it became clear some things were more important than originally thought, and some things less so. I periodically revisited the lists of issues and as time went by became more and more hard-nosed about which features remained in 1.0.
Another hurdle was deciding when the app is ready to ship. In addition to the feature set, there is so much that can be tweaked—the exact wording of labels, the default layout of tabs, which icons represent which tabs, tweaks to graphics. At a certain point, I needed to stop tweaking and send the app out into the world.
I am very excited to have released this first app, WALT, both as a user and as a developer.
As a user of WALT, I’m currently tracking my progress through the Silly Symphony film series where the Disney studio tested many of the animation technologies and techniques that were used in the first animated feature film Snow White.
As a developer, each project brings new learning and insights and this one was no exception. But, there is also no denying it is a very good feeling when something you have created is released into the world.
And for beginner iOS developers taking those first steps towards building an app, I invite you to join me as I lead a Full Day iOS Tutorial at CocoaConf in Portland, OR on October 25th.
I welcome your comments on this or any other blog post, or the app WALT itself at firstname.lastname@example.org.