Graphics Reference
In-Depth Information
TouchableView
. The application's delegate instantiates a
TouchMeViewController
and adds
it as a subview to the window that is constructed in the
MainWindow
xib file. The
TouchMeViewController
itself instantiates a
TouchableView
and adds it to its main view.
Because it receives the touch events,
TouchableView
is the focus of this example.
FIGURE 13-6
Start with a Window-Based Project
Building the TouchMeViewController
The
TouchMeViewController
is a subclass of the
UIViewController
and does not require
any protocol implementations. Therefore, the implementation file only has the
-init
and
-loadView
methods, as shown in Listing 13-5.
LISTING 13-5
TouchMeViewController.m Implementation
- (
id
)init
{
if
(![
super
init
])
return nil
;
return self
;
}