15.0. Introduction

You’ve certainly seen applications with beautiful graphics effects on iPhones or iPads. And you’ve probably also encountered impressive animations in games and other apps. Working together, the iOS runtime and Cocoa programming frameworks make possible an amazing variety of graphics and animation effects with relatively simple coding. The quality of these graphics and animations depends partly, of course, on the aesthetic sensitivities of the programmer and artistic collaborators. But in this chapter, you’ll see how much you can accomplish with modest programming skills.

I’ll dispense with conceptual background, preferring to introduce ideas such as color spaces, transformation, and the graphics context as we go along. I’ll just mention a few basics before leaping into code.

In Cocoa Touch, an app is made up of windows and views. An app with a UI has at least one window that contains, in turn, one or more views. In Cocoa Touch, a window is an instance of UIWindow. Usually, an app will open to the main window and the programmer will then add views to the window to represent different parts of the UI: parts such as buttons, labels, images, and custom controls. All these UI-related components are handled and drawn by UIKit.

Some of these things might sound relatively difficult to understand, but I promise you that as we proceed through this chapter, you will understand them step-by-step with the many examples I will give.

Apple has provided developers with powerful frameworks ...

Get iOS 5 Programming Cookbook 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.