Game Development with Swift
上QQ阅读APP看书,第一时间看更新

Setting up your development environment

Learning a new development environment can be a roadblock. Luckily, Apple provides some excellent tools for iOS developers. We will start our journey by installing Xcode.

Introducing Xcode

Xcode is Apple's Integrated Development Environment (IDE). You will need Xcode to create your game projects, write and debug your code, and build your project for the App Store. Xcode also comes bundled with an iOS simulator to test your game on virtualized iPhones and iPads on your computer.

Note

Apple praises Xcode as "an incredibly productive environment for building amazing apps for Mac, iPhone, and iPad."

To install Xcode, search for xcode in the App Store or visit http://developer.apple.com and click on the Xcode icon. Please note the version of Xcode you are installing. At the time of writing, the current version of Xcode is 6.3.2. Swift is continually evolving and each new Xcode release brings syntax changes to Swift. For the best experience with the code in this book, use Xcode 6.3.x (with Swift version 1.2).

Note

Apple announced Xcode 7 and Swift 2 at WWDC 2015, but it is still in Beta at the time of writing. It looks like there will be some minor syntax changes. The knowledge and techniques in this book will still apply.

Xcode performs common IDE features to help you write better, faster code. If you have used IDEs in the past, then you are probably familiar with auto-completion, live error highlighting, running and debugging a project, and using a project manager pane to create and organize your files. However, any new program can seem overwhelming at first. We will walk through some common interface functions over the next few pages. I have also found tutorial videos on YouTube to be particularly helpful if you are stuck.