codea
iOSSwiftSwiftUIbeginners

Learn Swift and SwiftUI from scratch: an iOS guide

What you need to build iPhone apps, the order to learn Swift and SwiftUI and 3 portfolio projects to land your first iOS job.

October 17, 2026 · 2 min read

iPhone apps are built with Swift, Apple's language, and SwiftUI, its modern way of building screens. If iOS appeals to you, this guide tells you what to learn first and what to build.

1. What you need before you start

  • A Mac. Xcode, the official free editor, only runs on macOS. It includes the iPhone simulator.
  • An iPhone is optional. You can install your apps on your own phone with a free account (Personal Team), without paying for the developer membership.
  • About 10 hours a week and Git from day one.

2. Swift: the language

Swift is modern, safe and quite readable. What matters most at first:

  1. let (constant) and var (variable), types and type inference.
  2. Optionals: a value that may not exist. Learn if let, guard let and ??, and avoid !.
  3. struct, class and enum. In SwiftUI almost everything is a struct.
  4. Collections and functions like map, filter and sorted.
let name: String? = nil
print("Hi, \(name ?? "guest")")

3. SwiftUI: the screens

In SwiftUI you describe what the screen looks like for a given state, and SwiftUI updates it. Learn in this order:

  1. Views and layout: Text, Image, Button, VStack, HStack, List.
  2. State: @State and @Binding; then @Observable for your ViewModels.
  3. Navigation: NavigationStack, .sheet and TabView.
  4. Networking: URLSession with async/await and Codable to read JSON.
  5. Architecture and data: MVVM, UserDefaults for preferences and SwiftData to store data on the phone.
  6. Quality: tests with Swift Testing or XCTest and the Xcode debugger.

4. Portfolio projects

  • My Playlist: song lists with a detail screen and favorites. You practice List, state and navigation.
  • Allowance tracker: an expense tracker with forms, MVVM and SwiftData.
  • Pokédex: uses PokéAPI with async/await, handles loading and errors and keeps a cache.

Put simulator screenshots in each repo's README: in iOS, screenshots sell.

5. Common mistakes

  • Using ! to force-unwrap optionals. It's the most common cause of beginner crashes.
  • Storing passwords in UserDefaults. It isn't secure: that's what the Keychain is for.
  • Ignoring older code. In real teams you'll see ObservableObject and @Published; learn to read them.
  • Not showing error states. A screen must know what to do when there's no internet or the list is empty.

If you've never coded, start with how to start programming from scratch. And if you prefer Android, see how to start Android development.

Next step

Codea's free iOS Developer Jr route takes you in 6 weeks from Swift and Git to a real-work simulation, with challenges, quizzes and teacher review. Route content is in Spanish.

Learn this step by step, for free

Videos, hands-on challenges, quizzes and teacher reviews (route content is in Spanish).

Start the routeSee syllabus