In this post, we’re going to take a step-by-step walkthrough of how to create a new project in Xcode 5. This post is really aimed at the absolute beginner but can be a useful reminder for those who haven’t got that much experience with Xcode. In order to follow along with this tutorial, you should have already completed the steps in one of my other posts – How to Install Xcode.When you first start Xcode you’ll be presented with the Xcode Welcome Window. This will display the version of Xcode that you’re using as well as provide quick ways to get started, either by:
- Creating a new Xcode project
- Checking out an existing project from a source code management repository
- Opening a recent project
- Opening an other project
We’ll get started by creating a new project of our own. Click the Create a New Xcode project menu entry.
Xcode will present you with a screen that allows you to choose a template for your new project.
As you can see from the screenshot, there are two main groups of templates, those for developing iOS applications and those for developing applications for OS X.
On the right-hand side of the window are the templates that are available. If you select one, the area toward the bottom-right of the window provides you with some brief information about the template you have selected.
Feel free to click around the menu on the left-hand side as well as the templates on the right and familiarise yourself with the sorts of templates that are available to you.
When you’re ready, select the iOS > Application menu entry on the left-hand side. On the right, select Single View Application and press the Next button.Xcode will now present you with a screen where you can fill in the options for your new project.
The Project Name will be the name of the application that you want to create. For now, I’m just going to call it Example Project.
Fill in your Organization Name, iOS Development Tutorials in my case.
Next, enter your Company Identifier. With the Company Identifier the convention is to use your domain name (if you have one) in reverse order so in my case it would be com.iosdevelopmenttutorials. If you haven’t got a domain of your own, put something that your pretty sure will be unique. Just remember, whatever you put in can’t contain any spaces.
Next, fill in a Class Prefix. If your familiar with what a class is, the characters you add in this field will be pre-pended to the name of any class you create within the project. This helps you to avoid name clashes with classes that might be found within the iOS SDK. I usually put my initials or the initials of my organization.
The Devices drop-down then lets you select the target for your project. For now, we’re just going to select iPhone but if you want to you can choose iPad or even Universal. If you select Universal, when your project is created, it will create template interfaces for both the iPhone and iPad. Once you’ve filled in all the fields, select the Next button.
The final step in creating your project is to select a location in which to store it.
I usually create a folder in my home directory called Development and save all my projects in there but feel free to save it wherever you like.
One option on this screen that we’ll talk about more in another post is the Source Control option. If you select the checkbox, it will place your project under source control (using a source control program called git) and will allow you to track changes and work with others on your project. For now, it doesn’t really matter what you put here. Once your done, select the Create button.Xcode will now create your new project based on the template we selected (a single-view application) and will store it in the folder you selected. Once it has finished it will display the Xcode Workspace Window for your project. And with that last step, you’re done. You’re nice shiny new project is ready to be moulded into your next iOS app masterpiece!