Skip to content
edwardinubuntu edited this page Dec 13, 2010 · 9 revisions

Welcome to the Painter wiki!

Introduction

The Painter app turns the iPhone screen into a virtual canvas. The user paints by dragging one or more fingers across the screen. (OK!)
The line color and thickness can be set by touching the info button in the lower-right corner of the screen. (OK!)
The control panel includes a slider for line width and red, green and blue sliders for line color. (OK!)
As the Line Width slider is moved from left to right, the width of the line increases. (OK!)
At the bottom of the screen, two buttons allow the user to turn a finger into an eraser or clear the screen entirely. (OK!)
At any point while painting, the user can shake the iPhone to clear the entire drawing from the screen. (OK!)

Wrap-Up

From this Painter app, we can learn about how to custom UIViewController and FlipsideViewController. How to handle all three types of touch events, along with motion events generated when the user shakes the iPhone. Also can see how to store primitives and structures in collections user the NSValue class, and how to selectively redraw a UIView to optimize the app's performance.

Clone this wiki locally