Building Apps from Sample Code
You can learn so much by building complete sample projects in Xcode. Unlike the templates, sample projects are either complete apps with all features present or demonstration projects for specific features. Use them to understand how apps are constructed and to view working code.
You can find sample code in two places:
In the documentation. These projects are created by Apple’s internal developers and support staff.
Online. These projects are created by both amateur and professional developers outside Apple.
Building sample projects from the documentation
Sample Code is one of the resource types introduced in Chapter 2. You can access it in two ways:
From the Organizer in Xcode. With this option, sample projects are loaded into Xcode with a single mouse click, as shown in Figure 3.15.
Online. When you access the documentation online, sample projects are downloaded, usually as zipped files. Finder unzips files automatically.
Both options save the project files into a designated folder. You can run sample projects from your /Downloads folder, but it’s often ...