Hello World Project – Getting Started With Xcode

Featured image by fhirART on flickr. Modified. Used under Creative Commons License Attribution Generic 2.0.

This tutorial is meant to get you up to speed with using Xcode and creating new projects. This is to avoid being repetitive in future tutorials.
Enjoy!

Install Xcode

Download Xcode for free on the Mac App Store

Create Your Project

Now it’s time to create your first project. Let’s make a Hello World! application.
Open Xcode
Go to file->New->Project (See Image 1-1)

Image 1-1
Image 1-1

Now make sure Application is selected on the left menu, then select “Single View Application”. (See Image 1-2)

Image 1-2
Image 1-2

Click “Next”.
Enter your app name in the field next to “Product Name:”.
Make sure your Language is set to Objective-C.
Leave “Use Core Data” unchecked.

Image 1-3
Image 1-3

Click “Next”.

Your project is now created! You have a blank slate to work off of. To view your app so far, click on the triangle run button at the top left of the screen. (See Image 1-4).

Image 1-4
Image 1-4
Tip:
The keyboard shortcut for running your project is ⌘R

Hello World

Now we’re going to add some text to your project to make it a little more interesting.
Click on the file called “Main.storyboard”.
The window on the bottom left of the screen is called your Object Library. Scroll through it until you find a Label. Drag the label onto your View Controller. (See Image 2-1)

Image 2-1
Image 2-1

Now if you run your project, you should see a label on the screen. But we have a problem! The image is off to the side of the screen. We should make it centered.

Click on the label you just added. Now go to Editor->Align->Horizontal Center in Container. (See Image 2-2).

Image 2-2
Image 2-2

Now click on the label again. This time, go to Editor->Align->Vertical Center in Container.

Run your project again. Your label should be centered horizontally and vertically.

To change the text of the label, just double click on it and start typing. Change the text to “Hello World!”.

Now run the project again. Your simulator should look like Image 2-3.

Image 2-3
Image 2-3

That sums up this simple tutorial. Good job, you’re well on your way to making the next Angry Birds!

Angry Birds Balloon

Above Image taken by Garrett Heath from Flickr. Image modified by cropping. Licensed under the Creative Commons Generic Attributions 2.0.

Download Final Project

Feel free to download the completed result of going through this tutorial.

Download Now