Drawing Images

Often, as part of a custom view’s drawing, you will want to draw an image on the screen. Cocoa makes this extremely simple.

To try it out, you are going to make a small Cocoa application which draws an image. When you are done, the app will have a view that draws a regular grid of images (Figure 17.11)

Figure 17.11  The finished ImageTiling project

The finished ImageTiling project

In Xcode, create a new Cocoa Application project called ImageTiling (Figure 17.12).

Figure 17.12  Configuring the new ImageTiling project

Configuring the new ImageTiling project

As you did with ...

Get Cocoa Programming for OS X: The Big Nerd Ranch Guide 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.