O'Reilly logo

Mac Application Development by Example Beginner's Guide by Robert Wiebe

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – saving the strokes

Similar to how we created a custom view for our finger touches, we can create a second custom view for completed strokes.

  1. Create a new file in Xcode, using the Mac OS X Cocoa Objective-C class template, that is a subclass of NSView, and call it BTStrokeView.
  2. 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.
  3. Select the new Finger View, and in the Identity inspector, change its Class to BTSStrokeView.
  4. 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:
  5. In the file named BTSStrokeView.h ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required