
Swift Game Development
By :

There are three quick items to take care of before we start drawing. To begin the preparation, go through the following steps:
Since we will design our game to use landscape screen orientations, we will have to disable the portrait view altogether:
With your game project open in Xcode, select the overall Project
folder in the project navigator (the uppermost item).
You will see your project settings in the main frame of Xcode. Under Deployment Info, find the Device Orientation section.
Uncheck the Portrait option, as shown in the following screenshot:
We need to resize our scene to fit the new landscape view. Follow these steps to resize the scene:
Open GameViewController.swift
from the project navigator and locate the viewDidLoad
function inside the GameViewController
class. The viewDidLoad
function is going to fire before the game realizes it is in landscape view, so we need to use a function that fires later in the startup process. Delete viewDidLoad
completely, removing...