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.xcworkspacegroups 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?"
A new hike-list screen
Code → a new Swift file inside a
Hikesgroup.
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.
Where do you add TrailLog's app icon?
What is a target?
The app must explain why it wants the camera. Where does that text go?
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.
