Free course · 11 lessons · Intermediate

iOS with SwiftUI

Build modern iPhone and iPad apps with Swift and SwiftUI: views, layout and lists, state with @Observable, NavigationStack, networking with async/await and Codable, persistence with SwiftData, Swift concurrency and actors, app architecture and dependency injection, Swift Testing, accessibility, and shipping through TestFlight and the App Store. The SwiftUI code is shown in full, and the logic in every lesson is compiled and run.

Start the course

1. SwiftUI Foundations: Views, Layout, Lists and State

Create an iPhone app with SwiftUI in Xcode, compose views with modifiers and stacks, show data in lists, and manage state with @State, @Binding and the Observation framework.

  1. Your First iPhone App with SwiftUI — Create a project in Xcode, understand the App and View structs, preview your UI live with #Preview, and run the app in the simulator or on your iPhone.
  2. Layout with Stacks, Modifiers and Adaptive Design — Arrange views with VStack, HStack and ZStack, size and space them with frames, padding and Spacer, understand why modifier order matters, and support Dynamic Type, dark mode and iPad.
  3. Lists, ForEach, Sections and Search — Show collections with List and ForEach, give rows stable identity with Identifiable, group them in sections, add swipe actions, pull to refresh and search.
  4. State and Data Flow: @State, @Binding and @Observable — Choose the right tool for each piece of state: @State for view-local values, @Binding for two-way access, @Observable models for shared state, and the environment for app-wide dependencies.

2. Navigation, Networking, Persistence and Concurrency

Move between screens with NavigationStack, load JSON from an API with async/await and Codable, store data on the device with SwiftData, and keep the app responsive and data-race free with Swift concurrency.

  1. Navigation with NavigationStack and Sheets — Push screens with NavigationStack and value-based NavigationLink, drive navigation from a path you own, present sheets, and handle deep links.
  2. Networking with URLSession, async/await and Codable — Fetch JSON from a REST API with URLSession and async/await, decode it with Codable, check HTTP status codes, map errors to messages, and load data with the .task modifier.
  3. Persistence with SwiftData — Store data on the device with SwiftData: @Model classes, a model container, @Query to read and the model context to insert and delete, plus how to cache server data for offline use.
  4. Swift Concurrency in an App: MainActor, Tasks and Actors — Keep the UI responsive and free of data races: the main actor for UI state, tasks and cancellation, actors for shared caches, and what the Swift 6 language mode checks for you.

3. Production: Architecture, Testing, Accessibility and the App Store

Structure the app for testability with view models and dependency injection, test it with Swift Testing and UI tests, make it accessible and fast, and ship it through TestFlight and App Store review.

  1. App Architecture and Dependency Injection — Organise a SwiftUI app into views, observable view models and services behind protocols, inject dependencies through initializers and the environment, and swap in fakes for previews and tests.
  2. Testing iOS Apps with Swift Testing and XCUITest — Unit-test view models and logic with Swift Testing, including async code and parameterized tests, and cover critical flows with UI tests.
  3. Accessibility, Performance and Shipping to the App Store — Make the app usable with VoiceOver and Dynamic Type, find performance problems with Instruments, and ship through TestFlight, App Store review and phased releases.

Was this page helpful?