← All courses

Xcode & Project Structure

🗓 May 31, 2026 ⏱ 3 min read

What is Xcode?

Xcode is Apple’s all-in-one development tool. It contains the code editor, the UI design tools (Interface Builder and SwiftUI previews), the Simulator (a virtual iPhone on your Mac), the debugger, and the tools to build and submit apps. Everything you do as an iOS developer happens here.

Creating a project

  1. Open Xcode → Create New Project.
  2. Choose App under iOS.
  3. Enter a product name, your organisation identifier (like com.yourname), and pick the interface (Storyboard for UIKit, or SwiftUI).
  4. Choose a location and click Create.

The key files and folders

  • App entry file (AppDelegate/SceneDelegate for UIKit, or the @main App struct for SwiftUI) — where the app starts.
  • ViewControllers / Views — your screens.
  • Main.storyboard (UIKit) — a visual layout of screens, if you use Interface Builder.
  • Assets.xcassets — images, app icon, and colors.
  • Info.plist — app configuration: display name, permissions descriptions, supported orientations.
  • The project file (.xcodeproj/.xcworkspace) — build settings and configuration.

Running on the Simulator and a real device

Pick a simulator (e.g. iPhone 15) from the toolbar and press the ▶ Run button. To run on your own iPhone, plug it in, sign in with your Apple ID under Signing & Capabilities, select the device, and Run. Apple requires every app to be “signed” with a certificate — Xcode handles this automatically for development.

Adding libraries with Swift Package Manager

To add third-party code, use the built-in Swift Package Manager: File → Add Packages, paste a package’s URL, and Xcode downloads and links it. This is the modern replacement for older tools like CocoaPods.

Permissions live in Info.plist

If your app uses the camera, location or photos, you must add a usage description string in Info.plist (e.g. “This app uses the camera to scan QR codes”). iOS shows this text when asking the user, and your app crashes if the key is missing — a very common beginner bug.

Debugging basics

Set a breakpoint by clicking the line gutter; execution pauses there so you can inspect variables. Use print() for quick logs, and read the console at the bottom when something goes wrong.

Common mistakes

  • Forgetting the Info.plist usage description for a permission (instant crash).
  • Opening the .xcodeproj when a .xcworkspace exists — always open the workspace.
  • Not selecting a development team under Signing for device runs.
Summary: Xcode is your entire toolchain — editor, Simulator, debugger and submitter. Know the entry file, Assets, and Info.plist (especially permission strings), and add libraries with Swift Package Manager.