Game Development Reference
In-Depth Information
In Figure
3-8
, we see the details of the file
GameController_iPhone.xib
on the left. On the right, we
see the
IBOutlets
and
IBActions
defined in the file
GameController.h
.
Reviewing GameController_iPhone.xib
Under the Objects section on the left, we see a number of
UIViews
. The Landscape Play view
and the Portrait Play view are shown when the game is being played, which is the only time this
application supports both orientations. For simplicity, the rest of the views are for portrait
orientation only.
When the application initializes, we know that the first view the user sees is the Loading view. After
that, the user is directed to the Welcome view. In Figure
3-8
, we can see that both of these views
UIViewControllers
in the XIB. These two
UIViewController
because the each contributes a reasonable amount of
UIViewController
classes. As a
UIViewController
in other applications.
3-8
, we see the connections defined in the class
GameController
. We can also
Listing 3-1. GameController.h
#import<UIKit/UIKit.h>
#import "CoinsController.h"
#import "CoinsGame.h"
#import "HighscoreController.h"
@interface GameController : UIViewController<CoinsControllerDelegate>{
IBOutlet UIView *landscapePlayView;
IBOutlet UIView *landscapeGameHolderView;
IBOutlet UIView *portraitPlayView;
IBOutlet UIView *portraitGameHolderView;
IBOutlet UIView *loadingView;
IBOutlet UIView *welcomeView;
IBOutlet UIButton *continueButton;
IBOutlet UIView *aboutView;
IBOutlet CoinsController *coinsController;
IBOutletCollection(UILabel) NSArray *remainingTurnsLabels;
IBOutletCollection(UILabel) NSArray *scoreLabels;