Tag Archives: UIKit

Renaissance, the iOS app makers’ conference, is happening in San Francisco from January 21-23. It looks to be an excellent event and I am excited to be a part of it.

As part of the program, Chris Clark from Square and I will be presenting Beautiful Text, a session covering both design and technical aspects of text in iOS apps.

In addition, Renaissance will feature a special musical performance by James Dempsey and the Breakpoints.

My excitement for the conference goes beyond any particular session. I believe Renaissance will be an experience much greater than the sum of its parts. Here are a few things that have me looking forward to Renaissance:

The lineup of speakers is impressive. I would go out of my way to hear any number of these folks speak individually. With so many people I respect and admire presenting, the event promises to be something special.

The conference format means that by hearing development, design and business topics woven together in a single track, you can take in everything without missing anything. I think bringing topics together that are often sequestered in separate tracks will spark a lot of interesting ideas.

Finally, I’m looking forward to meeting a lot of great people at the conference. Twitter, Skype and email can be fantastic ways to keep in touch, but there is something about meeting people in person that has yet to be matched by communication technology.

If you are considering coming to Renaissance, the price goes up on January 1st, so now is a great time to book the ticket. (Plus, if you live someplace cold and snowy, attending Renaissance can also be the literal rebirth of getting the feeling back in your fingers and toes.)

If you are already coming to Renaissance, please say hello. It would be great to meet you. I really hope to see you there. •

TICKET UPDATE: The ticket price discount for Renaissance has been extended until January 8th!

ADDITIONAL DISCOUNT:Contact me if you’d like to use my discount code to save an additional $100 on registration for Renaissance.

I was traveling the week between the iPhone 5 announcement and release. I returned from my trip champing at the bit to update my app WALT to use the entire 4-inch display, instead of being stuck in the letterbox ghetto. Updating turned out to be simple and straightforward. Here’s how it went.

Out of the letterbox

The first step was getting out of the letterbox. To do this, I upgraded the project to use the iOS 6 SDK and added a new 640 × 1136 launch image for the new screen size. Like all launch images, it needed to have a particular name: Default-568h@2x.png. There’s a lot of information encoded in that file name—the default launch image name, the screen height, the high-resolution size and the image format.

Enabling a feature by adding a specially-named image is a clever and compact approach, but it is not very obvious or discoverable on its own. Xcode 4.5 helps by displaying a project warning and offering to create the new launch image for you. (Although I see the warning now in a test project, I don’t remember seeing it when I updated WALT.)

Xcode 4.5 adds a few other features to support development for Retina 4 displays. The iOS Simulator has a new hardware device setting so you can test your app with the new size, even if you haven’t been able to get your hands on an iPhone 5.

When viewing storyboards, Interface Builder makes it very easy to toggle between Retina 3.5 and Retina 4 sizes using a newly-added resize button.

New resize button toggles storyboards between 3.5 and 4-inch views

If you are not using storyboards, Interface Builder still has you covered. You can change the screen size for a top-level view in the Simulated Metrics section of the attributes inspector. This setting is also available with storyboards, but I have found the single toggle to be much more convenient to use.

Choose which size to work with in a xib

Mostly done already

Since WALT uses standard tab, navigation and table views, there was nothing additional required to effectively use the additional screen space. Each table view became taller and now displays more content. I could have released the app as-is, but wanted to do a few tweaks.

On a Retina 3.5 screen, the film detail view in my app adjusts row heights in certain cases to improve the layout. I needed to make different adjustments for Retina 4 screens, so I needed to tell the two screen sizes apart. The new screen size is not a different user interface idiom—just a taller iPhone. For screen size, the highest level API available is to use UIScreen to get the height of the main screen:

CGFloat mainScreenHeight = [UIScreen mainScreen].bounds.size.height;

I‘ve already seen a number of online examples that use the screen size to add convenience category methods to UIScreen or UIDevice. In my case, I checked the screen size inline in the one place where it was needed.

What Up, Fishes?!The newly added ‘Partysaurus Rex’ looks nice and comfy, all stretched out on a beautiful iPhone 5 in the new version of WALT.

Although my experience was quick and painless, the amount of work needed to adapt an app for 4-inch screens varies greatly depending on its contents. The iOS Human Interface Guidelines document suggests different approaches for various situations. It also makes a very important point that applies to all apps. An app should remain the same app, with the same features and interaction, regardless of which screen size it is being displayed on. But, when displayed on a 4-inch screen, it should reveal more of its content.

In summary, getting your app to stretch out to the full iPhone 5 screen is as easy as updating to the latest SDK and adding a new launch image. Getting your app to look great, however, will depend on how customized your views are.

For me, I found that getting the app ready for iPhone 5 took less time than preparing the new set of taller screenshots required for the App Store. •

WALT 1.0.1 is available now in the App Store with iPhone 5 and iOS 6 support.

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.

Ship It

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.

Wrap Up

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.