Chapter 3. Your first app, explained
This chapter covers
- Xcode templates
- Understanding single-view applications
- Using labels
- The iOS Simulator
In chapter 2, you launched Xcode, created a new project, set your project options, added a label to the app, and ran it in the Simulator for the first time. This chapter will now explain the steps that you took so you’ll understand not only what you did, but why you did it.
Starting from the top: when you launched Xcode and clicked File > New > Project, a menu item opened a window of templates. What is a template, anyway? Apple has created the basic structure or guts of several popular types of mobile applications within the Xcode application. Think of it as though you’re preparing a difficult task—like repairing a bicycle. You get out all the parts that you know you’re going to need, and in some cases, you assemble some parts before you even touch the bicycle. In the same way, Apple has already made some of the project infrastructure for you, knowing you’ll need certain things to complete the project.
The templates are powerful and can help you complete your application in a shorter amount of time, but it’s important to understand how they work before you begin relying on them too much. You started your Hello World app in chapter 2 by selecting the Single View Application template (shown in figure 3.1) during the creation of your new project. You may be wondering what that is. I’ll explain next.