Similar to how we created a custom view for our finger touches, we can create a second custom view for completed strokes.
Create a new file in Xcode, using the Mac OS X Cocoa Objective-C class template, that is a subclass of
NSView
, and call itBTStrokeView
.In the
.xib
file, click on the Finger View object and select Duplicate from the Edit menu to make a copy of the Finger Viewobject.Select the new Finger View, and in the Identity inspector, change its Class to
BTSStrokeView
.In the Objects hierarchy, drag the Finger View object into the original Stroke View object to make it a subview of the original object. The new Objects hierarchy will look as shown in the following screenshot:
In the file named
BTSStrokeView.h
, add a@property
that will be used to reference the mutable array that will hold the savedBTSStroke
objects. We are also going to need a method to add strokes to them_Strokes
array so we can define the interface for that method as well.#import...