Graphics Programs Reference
In-Depth Information
@interface HypnosisViewController : NSObject
@interface HypnosisViewController : UIViewController
@end
A view controller is responsible for creating its view hierarchy.
HypnosisViewCon-
troller
's view hierarchy will be made up of only one view, an instance of
Hypnos-
and
HypnosisView.m
in
Finder
and drag them into
HypnoTime
's project navigator.
In the sheet that appears, check the box to
Copy items into destination group's folder
and
click
Finish
(
Figure 7.3
). This will create a copy of the two files, add those files to
Hyp-
noTime
's directory on the filesystem, and then add them to the
HypnoTime
project.
Figure 7.3 Adding HypnosisView to HypnoTime
A
UIViewController
subclass creates its view hierarchy by overriding the method
loadView
. This method creates a view instance and sets it as the
view
of the view con-
troller. In
HypnosisViewController.m
, override
loadView
, making sure to im-
port the header file for
HypnosisView
at the top of this file.