You’ve certainly seen applications with beautiful graphics effects on iOS devices. 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
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 with the many step-by-step examples I provide.
Apple has provided ...