Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Xcode  ›  Lesson

Project Files and Groups

Project Files 12 minAn Xcode project holds targets, each building one product, plus files such as the app delegate, storyboards, the asset catalogue and Info.plist, organised into groups.

Project Files and Groups

Open TrailLog's Project navigator and you see a tree of files you did not write: an asset catalogue, a plist, two storyboards, delegates. Each has one job. Knowing them means you know where every change belongs.

The rule

The project describes how to build; targets say what to build; files hold the pieces.

At the top of the Project navigator is the project (the blue icon). Clicking it shows its targets. A target is one product to build — the TrailLog app, its unit tests, maybe a widget later — each with its own build settings, signing and list of files.

The template creates these for a UIKit app:

  • TrailLog.xcodeproj — the project package on disk. It stores targets, build settings and the file list. A .xcworkspace groups several projects together, for example when dependencies live in their own project.
  • AppDelegate.swift — marked @main; the app's entry point. Handles app-wide events like launch.
  • SceneDelegate.swift — manages one window (a scene): setting it up and reacting when it goes to the background.
  • ViewController.swift — the first screen's code.
  • Main.storyboard — the first screen's layout. LaunchScreen.storyboard — the still image shown while the app starts.
  • Assets.xcassets — the asset catalogue: app icon, images and named colours.
  • Info.plist — key–value settings the system reads, such as usage descriptions ("TrailLog uses your location to record routes"). Many of these now appear in the target's Info tab instead of a separate file.

A SwiftUI template swaps the delegates and storyboard for a TrailLogApp.swift file marked @main and a ContentView.swift.

Groups are the folders in the navigator. Traditionally a group was just a label inside the project file and did not have to match the folders on disk. Recent Xcode versions (16 and later) create folders synchronised with disk: add a file to the folder in Finder and it joins the project automatically. Either way, group by feature — Hikes, Map, Settings — rather than by kind of file.

The shortcut

For any change, ask "Is it code, a picture, a system setting, or a build setting?"

Where TrailLog changes goStep 1 of 4
  1. A new hike-list screen

    Code → a new Swift file inside a Hikes group.

The trap is editing build settings on the wrong target — changing the test target when you meant the app.

Drills

Answer fast — trust the rule.

quick drill

Where do you add TrailLog's app icon?

quick drill

What is a target?

quick drill

The app must explain why it wants the camera. Where does that text go?

quick drill

In a UIKit template, which file is marked @main as the app's entry point?

Remember

  • The project describes how to build; each target is one product; files hold the pieces.
  • Shortcut: code, picture, system setting or build setting — each has its home.
  • Group by feature, and check which target you are editing.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainWhere does it go?

For TrailLog, say where each change belongs and why: a new Map screen's code, a green brand colour used across the app, the text shown when asking for photo access, and support for an older iOS version.