We can now look back at our project and implement the program code needed to draw the strokes that are active. There are two classes that are included in the sample code project but that are not discussed in detail here. While they are not essential to understanding multi-touch it is recommended that we examine the code, for completeness. We will need the files that implement these classes included in our project so that our multi-touch paint program can run.
In Xcode, examine the program code in the files named
BTSPoint.h
,BTSPoint.m
,BTSStroke.h
, andBTSStroke.m
so that we are familiar with these two objects that will be used during the painting process to create colored strokes in our customNSView
object.Create new files that match these files so that the project we are working on has these objects implemented.
We are going to need to allow the App user to select the color for each finger to paint. To do this, we need to add a new custom view...