Implementing the Design

The design has defined the roles and public interfaces of the various classes in TransparentTetris. The implementation of each class is straightforward. In some cases, private methods and private categories are needed. Several idioms that are unique to Cocoa applications are described along with their uses in the implementations.

The user interface is built in Interface Builder. A MYBlockView instance is used to display the game board. An instance of the MYGameController class is instantiated in Interface Builder and made the application object’s delegate. An instance of NSImageView is used to provide a background behind the game board, and made editable so that the user can set the background image via drag and drop ...

Get Cocoa® Programming 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.