Time for action – using the barebone project as a template
Follow these steps to use the barebone
project as a template:
Copy the
barebone
application from samples | barebone to a location of your choice.Open up the project in Xcode by double-clicking on
Barebone.xcodeproj
.Click on the project name in the project navigator to make it editable.
Rename it to
PirateGame
.Open the Product menu from the top menu bar.
Select Scheme and Manage Schemes.
Rename the Scheme name from Barebone to
PirateGame
.Run the project in the iOS Simulator by hitting the play button. Make sure PirateGame is selected and not Sparrow.
What just happened?
We copied the barebone
Sparrow template and used it as a template for our game. We renamed all project and scheme references and ran the template in order to see if everything went ok.
The indication for everything working as expected is when there are no errors while compiling the template and a red rectangle shows up on the screen.
Option 2 – CocoaPods
CocoaPods is a dependency manager for Objective-C projects. It can handle Mac OS X and iOS dependencies alike and is similar to package managers of other systems. It can be compared to what Ruby's package manager RubyGems is to the Ruby platform or what NPM is to Node.js.
CocoaPods needs Ruby and RubyGems to run, which is nothing to worry about, as both come preinstalled on every Mac OS X machine.
Before we begin installing CocoaPods, we need to make sure that the command-line tools are installed.