Are you new to developing with Apple software? This blog is perfect for beginners and explains the tools you need to begin iOS app development.
Setup Development Environment
Before starting application development, you will need to set up the application development environment.
Make sure you have the following tools:
Click the above link, and Xcode will open on a browser and will show you the following screen.
Click on the “View in Mac App Store” button and then click Launch Application when prompted. It will open the App Store application on your Mac.
You will see a “Free” button on the left hand side, click this and it will prompt you to enter the user name and password for your apple developer account. If you are not registered with Apple, you can create an Apple ID here (include link to: https://appleid.apple.com/account)
Once you enter your account information, your application download will start. After Xcode downloads, it’s now time to start your application development.
How To Create A New Project Using Xcode
Open Xcode and click the “Create new Xcode Project” option.
There are many templates in Xcode, but we will start with the Single View Application template.
Click next and then fill in your information on the next screen.
After clicking next, Xcode opens with a new window known as the Work Space Window. From here you can create and run applications.
At the top of the screen in the tool bar area, select iPhone retina (3.5 –inch). Click on the “Run” button (circled in the photo below) to run the application in a simulator.
The simulator is a testing device for applications before you run them on an actual device. The iOS Simulator lets you test your applications quickly as you build them, and can simulate multiple devices.
After running the application on the simulator, you will see a blank screen like the one below.
You have now successfully set up all you need to create your first application.
Now that you have Xcode working, I will explain the software more in depth.
More about Xcode
Xcode has four main areas, which are shown in the figure below.
How to Add Controls To your Application
In the project navigator area workspace there are the following files:
Storyboard is a new feature for iOS developers and is introduced in Xcode 4.2 and iOS 5 SDK. Before Storyboard, developers could only work on a single screen of the application at a time. With storyboard you can see all screens at once.
Now, click on the Main.Storyboard file in your project navigator area, and you will see a visual editor in the Editor Area where you can place your controls.
From the Utility Area open the Object Library, select a label from it, and drag it into the Storyboard screen in the Editor Area. Then change the text of the label by double clicking on it and typing what you want it to be. In my example I wrote “Hello World.”
Now run the application (the arrow button in the top left of the screen), and you will see “Hello World” on your simulator screen.
Congratulations! You have now created your first iOS application!