Chapter 8: Better Drawing

Your users expect a beautiful, engaging, and intuitive interface. It’s up to you to deliver. No matter how powerful your features, if your interface seems “clunky,” you’re going to have a hard time making the sale. This is about more than just pretty colors and flashy animations. A truly beautiful and elegant user interface is a key part of a user-centric application. Keeping your focus on delighting your user is the key to building exceptional applications.

One of the tools you need in order to create an exceptional user interface is custom drawing. In this chapter, you learn the mechanics of drawing in iOS, with focus on flexibility and performance. This chapter doesn’t cover iOS UI design. For information on how to design iOS interfaces, start with Apple’s iOS Human Interface Guidelines and iOS Application Programming Guide, available in the iOS developer documentation.

In this chapter, you find out about the several drawing systems in iOS, with a focus on UIKit and Core Graphics. By the end of this chapter, you will have a strong grasp of the UIKit drawing cycle, drawing coordinate systems, graphic contexts, paths, and transforms. You’ll know how to optimize your drawing speed through correct view configuration, caching, pixel alignment, and use of layers. You’ll be able to avoid bloating your application bundle with avoidable prerendered graphics.

With the right tools, you can achieve your goal of a beautiful, engaging, and intuitive interface, ...

Get iOS 6 Programming Pushing the Limits: Advanced Application Development for Apple iPhone, iPad and iPod Touch now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.