Development mode — payments are simulated and emails go to the Dev Mailbox · Payment simulator
DDSP
Cover iOS App Architecture in Practice — page spread 1 iOS App Architecture in Practice — page spread 2 iOS App Architecture in Practice — page spread 3 iOS App Architecture in Practice — page spread 4 iOS App Architecture in Practice — page spread 5 iOS App Architecture in Practice — page spread 6 iOS App Architecture in Practice — page spread 7 iOS App Architecture in Practice — sample page iOS App Architecture in Practice — sample page iOS App Architecture in Practice — sample page

Design iOS apps that stay easy to change as they grow: architecture principles, MVC to MVVM with Observation, domain modeling and a Money type, a unidirectional store built from scratch, navigation with routers, coordinators, and deep links, dependency injection, use cases, repositories, error…

MVVM, Unidirectional Data Flow, Modular Swift Packages, and Dependency Injection for Apps That Scale

Read before you buy: the PDF here is a free sample — the first 20 pages of the 509-page book (payments, sales and reviews on this demo site are sample data). Get the full e-book at thenexbooks on Gumroad.

Build iOS apps a whole team can grow — without the tangle.

Most apps don't fail because one screen is hard to build. They fail slowly: every feature takes longer than the last, a change in one place breaks another, nothing can be tested without the whole app, and new developers need weeks to find their way around. Architecture is the handful of decisions that prevents this — clear boundaries, one-way data flow, explicit dependencies, a domain layer that knows nothing about screens or databases, and modules that make the right thing easy.

This book teaches those decisions by building one realistic app the way a real team would, and it always explains the trade-off: what each pattern costs and when you should not use it. It is written for developers who already build SwiftUI apps and now need structure — it does not re-teach Swift or SwiftUI basics.

What's inside

  • What architecture really is, what it costs, and the principles that scale: separation of concerns, the dependency rule, and testability as a design signal
  • From a massive view controller to MVVM with @Observable view models, and how to decide where every piece of state lives
  • Domain modeling with value types, typed IDs, and a Money type in integer minor units that never loses a cent
  • Unidirectional data flow: build a small reducer-based store yourself, then grow it with effects, cancellation, and composition — with a neutral look at TCA-style libraries
  • Navigation as state: typed routes, a router, coordinators for multi-step flows, deep links, universal links, and state restoration
  • Dependency injection done simply: initializers, the SwiftUI environment, a composition root, protocol witnesses, previews, test overrides, and when a container library is worth it
  • A domain layer with use cases, the repository pattern over SwiftData and a REST API, local-first data flow, and error handling that crosses layers cleanly
  • Modular apps with local Swift packages: designing the module graph, access control, avoiding cycles, what modularization does to build times, and a design system module
  • Configuration, build environments, xcconfig files, and feature flags with safe local overrides
  • Logging and analytics behind small abstractions, with privacy built in
  • Testing every layer with Swift Testing, architecture tests that stop boundary erosion, and Swift 6 concurrency treated as part of the design
  • Refactoring a legacy UIKit app incrementally, running UIKit and SwiftUI side by side, team conventions, code review, and Architecture Decision Records

One running example, start to finish. You build Pennyhaven, a fictional personal budgeting app with accounts, categorized transactions, and monthly budgets that warn you near the limit and flag overspending. Next to it lives Pennyhaven Classic, its first UIKit version — one huge view controller, a singleton, and money stored as Double — which you refactor step by step. By the end, Pennyhaven is a modular app with a pure domain package, a data layer, feature packages that never import each other, a hand-built store, a deep-link-driven router, explicit dependency injection, feature flags, and tests at every layer. The sample data is small enough to check by hand, and every total in the book was pre-computed.

Current and honest. The code targets the Swift 6 language mode, Xcode 26-era tooling, and a deployment target of iOS 18, with a few iOS 26 features clearly marked behind availability checks. It uses only Apple frameworks and packages you write yourself; third-party libraries are discussed neutrally as options. The book contains no invented benchmarks or build-time claims — it teaches you how to measure on your own project. Every chapter includes Swift code, Tips, Notes, Warnings, exercises, and Key Takeaways, and the appendices give you a cheat sheet, copy-ready templates, a production architecture checklist, and a glossary.

Format: PDF, 509 pages (A4), linked table of contents and bookmarks. English. First Edition, 2026. Published by thenexbooks. Requires a Mac with Xcode to run the code. Apple, iOS, Xcode, Swift, and SwiftUI are trademarks of Apple Inc. This book is independent and is not affiliated with, sponsored by, or endorsed by Apple Inc.

Table of Contents

Part I — Foundations

  • Ch 1 · Why Architecture Matters: Goals, Trade-offs, and Meet Pennyhaven
  • Ch 2 · Principles That Scale: Separation of Concerns, Boundaries, and Testability
  • Ch 3 · From MVC to MVVM: Observable View Models with the Observation Framework
  • Ch 4 · Modeling the Domain: Value Types, Typed IDs, and a Money Type You Can Trust
  • Ch 5 · State Ownership in SwiftUI: Sources of Truth, View State, and Data Flow

Part II — Flow and Navigation

  • Ch 6 · Unidirectional Data Flow: Building a Small Store Yourself
  • Ch 7 · Reducers, Effects, and Composition: Growing the Store
  • Ch 8 · Navigation Architecture: NavigationStack, Typed Routes, and a Router
  • Ch 9 · Coordinators and Multi-Step Flows
  • Ch 10 · Deep Links, Universal Links, and State Restoration

Part III — Dependencies, Domain, and Data

  • Ch 11 · Dependency Injection Fundamentals: Initializers, the Environment, and the Composition Root
  • Ch 12 · Advanced Dependency Injection: Protocol Witnesses, Containers, and Overrides
  • Ch 13 · The Domain Layer: Use Cases and Business Rules
  • Ch 14 · The Repository Pattern and the Data Layer
  • Ch 15 · Error Handling Across Layers

Part IV — Modular Apps

  • Ch 16 · Feature Modules with Swift Package Manager
  • Ch 17 · Designing the Module Graph: Boundaries, Access Control, and Avoiding Cycles
  • Ch 18 · Modularization and Build Times
  • Ch 19 · A Design System Module
  • Ch 20 · Configuration, Environments, and Feature Flags

Part V — Quality and Cross-Cutting Concerns

  • Ch 21 · Logging and Analytics Behind Abstractions
  • Ch 22 · Testability by Design: Testing Every Layer
  • Ch 23 · Architecture Tests and Fitness Functions
  • Ch 24 · Concurrency as Architecture: Isolation, Sendable, and Swift 6

Part VI — Evolving Architecture

  • Ch 25 · Refactoring a Legacy App Incrementally
  • Ch 26 · UIKit and SwiftUI Together in a Modular App
  • Ch 27 · Team Conventions, Code Review, and Architecture Decision Records
  • Ch 28 · Case Study: Pennyhaven End to End

Appendices
A · Architecture Cheat Sheet
B · Templates and Reference
C · Production Architecture Checklist
D · Glossary

Book details

Detail
Pages509
FormatPDF (A4)
LanguageEnglish
LevelIntermediate to Advanced
Edition1st Edition (2026)
Download on this siteFree sample, first 20 pages (PDF)
Publisherthenexbooks

Files you get

PDF
iOS-App-Architecture-in-Practice-Free-Sample.pdf
646.7 KB · version 1 · updated 18 Aug 2026

No reviews yet. Only buyers can review.

More from thenexbooks

Visit store
$9.00