All posts

Posts tagged with: Architecture

4 posts found

A relay runner mid-sprint on an outdoor track, baton in hand, captured at full stride — the same shape as a request that has to keep moving forward through a dropped connection, an expired token, or a second caller asking for the same thing.
Swift Networking

Retry, Token Refresh, and Request Deduplication in Swift

Day 23 of the 30-day iOS series. The three production concerns every 'build your own networking layer' tutorial skips, built as composable actors on top of Day 22's client — plus a real concurrency bug I found writing the test, not the code.

13 min read
A tangled mass of colorful telephone wires on the left resolving into a neatly organized black patch panel on the right — the same shape as replacing scattered URLSession calls with one clean networking layer.
Swift Networking

A Custom Networking Layer in 100 Lines of Swift — No Alamofire

Day 22 of the 30-day iOS series. URLSession, async/await, a generic Endpoint, and one typed error enum — the entire networking layer is 85 real lines, tested with a URLProtocol stub, and wired into a real BrewLog feature with a real local server.

11 min read
Colorful electrical wires and cables neatly arranged — red, yellow, blue, and green — representing connections and dependencies.
Swift Dependency Injection

Dependency Injection in Swift Without a Framework

Day 19 of the 30-day iOS series. Protocol-based DI, @Environment as a SwiftUI-native container, and the factory pattern — all without Resolver, Swinject, or any third-party glue. Includes a TDD example that shows why DI and testability are the same conversation.

11 min read
Colorful LEGO bricks — yellow, red, blue, and green — scattered on a white surface.
Swift Package Manager SPM

Modular Architecture With SPM: When to Split (And When to Absolutely Not)

Day 18 of the 30-day iOS series, opening Week 4 on architecture. Modularization with Swift Package Manager has a real cost in build time, package graph complexity, and maintenance overhead. I show the threshold rule I use across five apps — below which you don't split, above which you must — with a real Package.swift example from BrewLog and a pure Swift Testing suite that proves the point.

12 min read