Skip to content
All books
Stage 5 · Architecture

SwiftUI under load: the production SwiftUI book

Production SwiftUI under real load: 36 chapters and 12 failure labs, each a broken app you fix.

A production book, not a component reference.

The happy path is not the hard part of SwiftUI. The hard part is keeping the UI truthful and responsive while data arrives out of order, work is cancelled, identities change, images compete for memory and UIKit screens migrate behind a safe boundary.

Every performance claim is either tied to a measured source or identified as illustrative. The code, labs and staged repository are designed to make the central claims inspectable, not merely persuasive.

What you get

  • 36 chapters in nine parts: the production model, concurrency and effects, performance, architecture, migration, testing, delivery
  • Twelve failure labs as broken-then-fixed code
  • Ledger, a staged case study from broken baseline to production ready
  • Appendices: a code-review rubric, a performance incident workbook, a migration plan and exercise solutions
  • Complete adds six example apps with a commercial license, six workshop decks with answer keys and a workbook

A page from the book

Copied as printed, so you can judge the format before you buy.

Chapter 14, Lists with 10,000 items, page 83

Lists with 10,000 items

Failure signal

Ledger’s feed had 10,000 rows and used a LazyVStack, so the team believed the list was handled. Typing into search still froze the screen for hundreds of milliseconds per keystroke. The container was lazy, which meant rows were constructed on demand, but every keystroke normalized, filtered, grouped, and sorted the entire dataset on the main actor before any lazy construction happened, and unstable ids then caused broad row replacement on top of that. The lazy container had solved the one problem it solves and left every other problem in the pipeline untouched. “It is lazy” is not “it is fast.”

The decision

Design the complete data-to-row pipeline, not just the container: stable identity, bounded snapshots, filtering done off the main actor and cached, pagination with a gate, a prefetch policy, cheap row bodies, and measured image work. A large list is a pipeline, and its performance is the performance of its slowest stage, which is almost never the container.

Want more pages?

Before and after

Out-of-order search

Before

Every request updates the same result state when it finishes.

After

The latest user intent owns the result.

Older work is cancelled or rejected before it can overwrite the current query.

Image-heavy list

Before

The row downloads and decodes the original image on the UI path.

After

The pipeline sizes, decodes, caches and cancels deliberately.

The row receives stable, display-ready state without blocking scrolling.

Verified buyer

“I used to spend so much time watching different YouTubers trying to really understand SwiftUI. Then I came across one of Mike’s articles on Medium, loved the way he explained things, and decided to take the risk and buy the Complete Bundle. Yes, it’s not cheap, but after going through it, I can honestly say it’s worth every penny. The structure, the narrative, the demo project, the documentation… everything is incredibly well thought out. I absolutely love it. Easily one of the best investments I’ve made in learning SwiftUI!!!!!!!!!”

Andy Weir RGumroad verified purchase

Read the verified review on Gumroad

Choose your edition

Every edition includes free lifetime updates.

Reader

The complete book

$99

Read all 36 chapters without setting up a codebase.

  • Polished PDF and EPUB
  • Running Ledger case study
  • 13 diagrams
  • Appendices and indexes
  • Lifetime updates
Choose Reader, $99
Core edition

Professional

The core code edition

$189

The book plus the complete runnable companion repository.

Best fit for engineers who want the book and runnable labs.

  • Everything in Reader
  • 12 failure labs
  • 9 headless one-command tests
  • Staged repository and git history
  • Ledger iOS app and Xcode project
  • Instruments trace catalog
Choose Professional, $189

Complete

The apps and workshop edition

$359

Get the book, repository, six complete apps and structured workshop material.

  • Everything in Professional
  • 6 complete apps in full source
  • Commercial license to rebrand and ship
  • 6 workshop decks with answer keys
  • Exercise and review workbook
  • Release readiness checklist and post-rollout review
Choose Complete, $359

Team

Per team or per seat

Adopt the practices across an engineering team.

  • Everything in Complete
  • Team license
  • Facilitator guides
  • Manager and lead briefings
  • 90-day adoption plan
Ask about Team

What is inside

  1. 1The prototype-to-production gapp. 10
  2. 2The SwiftUI execution modelp. 15
  3. 3Identity and lifetimep. 21
  4. 4A taxonomy of state ownershipp. 26
  5. 5Observation in productionp. 32
  6. 6Main-actor UI architecturep. 39
  7. 7Tasks owned by viewsp. 45
  8. 8Stale results, deduplication, and backpressurep. 51
  9. 9Actor-isolated repositories and cachesp. 56
  10. 10Migrating to Swift 6.2 concurrencyp. 61
  11. 11SwiftData across isolation boundariesp. 66
  12. 12A scientific performance workflowp. 72
  13. 13Reading the SwiftUI instrumentp. 77
  14. 14Lists with 10,000 itemsp. 83
  15. 15Images and media pipelinesp. 89
  16. 16Environment and observation churnp. 95
  17. 17Layout, drawing, and animation costsp. 100
  18. 18Memory, energy, and thermal behaviorp. 106
  19. 19Feature boundariesp. 113
  20. 20MV, MVVM, reducers, and TCAp. 118
  21. 21Dependency injection without ceremonyp. 123
  22. 22Navigation as state and policyp. 128
  23. 23Modularization with Swift Package Managerp. 134
  24. 24SwiftUI inside UIKitp. 141
  25. 25UIKit inside SwiftUIp. 148
  26. 26Testing state and effectsp. 155
  27. 27Testing concurrency and cancellationp. 160
  28. 28Production diagnostics and field evidencep. 165
  29. 29Swift Testing and XCTest togetherp. 171
  30. 30UI, snapshot, and accessibility testingp. 180

Who this is for

This is for you ifYour SwiftUI problem appears only under cancellation, backgrounding, scale or ownership pressure.

  • You already ship SwiftUI and have felt it strain as the app, data or team grew.
  • You need production reasoning across performance, concurrency, state and migration, not another introduction to views and modifiers.
  • You want companion code you can run, break, inspect and verify.
  • You are introducing these practices across a mobile team or study group.

Not for

  • You are opening SwiftUI for the first time
  • You want a visual component catalog
  • You only want isolated recipes without the mechanism underneath
The library pathWhere this fits
  1. 01Get foundThe Silent Rejection
  2. 02Build the record and negotiateThe iOS Engineer playbook · Leverage
  3. 03InterviewThe iOS interview blueprint · The senior signal · Top 300 React Native interview questions · 500 Flutter interview questions · The senior SDET interview handbook
  4. 04Answer practice and live roundsThe 24-hour iOS interview answer book · The 24-hour Android interview answer book · Share your screen
  5. 05Architecture and qualitySwiftUI under load · Mobile System Design blueprint · Security is a feature · The second passYou are here
  6. 06Staff systems and ownershipAltitude · Ticket taker, outcome owner
  7. 07Build with AIBuild with your brain on (coming soon)
  8. 08LeadLeadership blueprint (coming soon)
  9. 09ArchitectArchitect blueprint (coming soon)
Portrait of Mike Salari

About the author

Mike Salari

Staff Mobile Engineer · Mobile Architect · Technical Author

I wrote this for intermediate and senior iOS engineers who already know how to make SwiftUI work and now need it to stay correct, responsive and maintainable under real production pressure.

15 years building production mobile software, with experience across Apple, Adobe, Cisco, Mastercard and Visa. 500+ technical interviews from the hiring side.

Read the full story

Before or after you buy

Not ready yet? Read the state ownership article →

Already own it? After the book, apply one failure lab to a production boundary you currently own. Use it in a system design context →

Free guides: Why iOS apps feel slow · Swift concurrency bugs that pass code review · SwiftUI architecture is state ownership

FAQ

SwiftUI under load: questions before you buy

Who is SwiftUI Under Load for?

Intermediate and senior iOS engineers who already ship SwiftUI and need stronger production judgment across performance, concurrency, state, migration, testing and CI.

Is SwiftUI Under Load suitable for beginners?

No. It assumes you already know SwiftUI and build iOS apps. It focuses on what happens when a working app grows, slows down, races requests, accumulates state and needs a safe UIKit migration path.

Which edition includes the companion code?

Professional is the core code edition. It includes everything in Reader plus the companion repository, twelve failure labs, the staged Ledger repository, the iOS app and Xcode project, and the Instruments trace catalog. Complete and Team include all Professional material.

Which edition includes the six full-source apps?

Complete is the only individual edition with the six complete apps and the commercial license to rebrand and ship them. Team includes everything in Complete plus the team adoption material.

What is included in the Reader edition?

Reader includes all 36 chapters as PDF and EPUB, the running case study, thirteen diagrams, the appendices and indexes, and free lifetime updates. It does not include the companion repository or runnable labs.

Does the code actually run?

The companion repository is designed to build and test on an Apple toolchain. Nine of the twelve broken-then-fixed failure labs run headlessly with one command. Professional, Complete and Team require Xcode 16 or newer.

Does the purchase include future updates?

Yes. Every edition includes free lifetime updates for the edition you purchase.

Make the app survive what comes after launch.

Choose the edition that matches how you want to learn, then turn the failures you can reproduce into fixes you can prove.

Share this book