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:

bullet_2c.tif In the documentation. These projects are created by Apple’s internal developers and support staff.

bullet_2c.tif 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:

bullet_2c.tif 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.

bullet_2c.tif 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 ...

Get iOS App Development Portable Genius now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.