Skip to content

Latest commit

History

78 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

iOS Architecture & Design Patterns

A collection of small, focused Xcode projects demonstrating architecture patterns and design patterns used in production iOS apps.

Each folder is a standalone project you can open, run, and study on its own.

What each project includes

Every project is built to the same standard, but not to the same shape. Early examples share a common feature (a list, a detail screen, a network call) so the architectures can be compared directly. Later ones deliberately break that mold. Some are visionOS or watchOS only, some have no network layer at all, some are built around a framework chosen specifically because the pattern has something to say about it.

What every project does share:

  • A real feature with real constraints, not a to-do list.
  • Unit tests for the core logic, and no test that touches the live network.
  • A short README explaining the pattern, when to use it, and its tradeoffs.
  • No third party dependencies unless the pattern specifically calls for one (for example, a Redux style project may use a lightweight state container library).
  • A stated platform and UI framework, since those choices are part of the tradeoff.

Project index

Every pattern and topic in the repository structure above, in one place. Items with a link are built. Everything else is planned and will be linked as it's added.

Architecture

PatternDescriptionProject
MVCAn iOS GitHub repository browser in UIKit: a list of a user's public repos backed by a diffable data source, a detail screen with stars, forks, language, and a relative updated line, pull to refresh, and an error alert with retry.GitHubBrowser-MVC
MVVMAn independent watchOS aurora forecast app on NOAA SWPC data: three days of Kp windows color coded by storm level, a detail screen per window, and a complication sharing the app's model layer.AuroraWatch-MVVM
MVVM-CA visionOS spatial Nine Men's Morris game on TabletopKit and RealityKit: a setup window, a board volume with all three game phases and mill capture, and an immersive space placing the board in three historical excavation sites.StoneMill-MVVMC
MVPAn iOS document based change ringing composition editor in UIKit on UIDocument: a system browser over .touch files, a row by row grid tracing a chosen bell's blue line, a notation bar and call strip for inserting bobs and singles at lead ends, a truth check that marks any repeated row, and AVAudioEngine playback of the row sequence.ChangeRinger-MVP
VIPERSplits a screen into View, Interactor, Presenter, Entity, and Router To be updated with actual description of projectChateline-VIPER
Clean Swift (VIP)Clean Architecture adapted for iOS with a unidirectional VIP cycleNot yet added
Redux / TCA styleCentralized, predictable state management for complex screensNot yet added

Concurrency

TopicDescriptionProject
Async/awaitStructured concurrency for networking and background workNot yet added
CombineReactive streams for handling asynchronous events over timeNot yet added
ActorsData race safe state isolation using Swift's actor modelNot yet added

Design patterns

Creational

PatternDescriptionProject
FactoryDelegates object creation to a dedicated type instead of calling the initializer directlyNot yet added
BuilderConstructs a complex object step by stepNot yet added
SingletonRestricts a type to a single shared instanceNot yet added
Dependency injectionSupplies a type's dependencies from outside instead of creating them internallyNot yet added

Structural

PatternDescriptionProject
AdapterConverts one interface into another that the rest of the app expectsNot yet added
FacadeProvides a simple interface over a more complex subsystemNot yet added
DecoratorAdds behavior to an object without modifying its original typeNot yet added
RepositoryAbstracts data access behind a single, consistent interfaceNot yet added

Behavioral

PatternDescriptionProject
ObserverNotifies interested objects when state changesNot yet added
StrategySwaps an algorithm's implementation at runtime behind a shared interfaceNot yet added
CoordinatorExtracts navigation logic out of view controllers into a dedicated objectNot yet added
State machineModels a screen or flow as a fixed set of states and transitionsNot yet added
CommandWraps a request or action as an object that can be queued or undoneNot yet added

Modularization

TopicDescriptionProject
Swift Package modulesSplitting an app into local Swift Packages for build speed and boundariesNot yet added
Feature flagsToggling features on and off without shipping a new buildNot yet added

Navigating and routing with SwiftUI

TopicDescriptionProject
NavigationLinkThe default, view driven way to push screens in SwiftUINot yet added
Dynamic navigationDriving navigation from state instead of hardcoded linksNot yet added
Centralized navigationA single router or path object owning navigation for a flowNot yet added
Combined tab and stackManaging navigation stacks nested inside tabsNot yet added
Deep linkingRouting a URL or notification straight to a specific screenNot yet added

Protocols

TopicDescriptionProject
Protocol-oriented programmingBuilding shared behavior with protocols and extensions instead of inheritanceNot yet added

Testing

TopicDescriptionProject
Snapshot testingCatching unintended UI changes by comparing rendered views against a reference imageNot yet added
UI testingEnd to end testing through XCUIApplicationNot yet added

Design patterns covered

Grouped using the classic creational, structural, and behavioral categories, plus an iOS specific concurrency section since async/await and Combine come up constantly in real codebases.

Some projects use SwiftUI, others use UIKit, and a few show both side by side for comparison. Each project README states which UI framework it uses.

How to use this repository

  1. Pick a pattern from the project index above or browse the folders directly
  2. Open the .xcodeproj or .xcworkspace inside that folder
  3. Read the local README first, it covers the reasoning before you read code
  4. Run the tests to see how the pattern affects testability

License

Released under the MIT License. © 2026 SarahUniverse

About

Small, realistic Xcode projects showing iOS architecture and design patterns in practice.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages