M-Swift Ship better iOS apps with Swift

M-Swift

Ship better iOS apps with Swift

Latest Articles

Watts in the Background: A Swift Team's Guide to Finding Battery Drain Before Users Do
AI & Performance

Watts in the Background: A Swift Team's Guide to Finding Battery Drain Before Users Do

Battery complaints rarely arrive with a stack trace. This walkthrough shows how to run a repeatable Swift energy audit with Instruments, os_signpost, and real devices so you can catch thirsty timers, refresh tasks, and network chatter before they become one-star reviews.

Your App Gained 12 MB and Nobody Blinked: Making Binary Size a Budget Item
Testing & Tooling

Your App Gained 12 MB and Nobody Blinked: Making Binary Size a Budget Item

Binary size regresses in tiny, blameless commits until one day the install is too big to ignore. Here is a repeatable audit — thinning reports, asset catalog forensics, framework triage, and a CI budget — that turns it back into a number your team owns.

Who's Actually Watching? Tracing SwiftUI Observation Dependencies After @Observable
AI & Performance

Who's Actually Watching? Tracing SwiftUI Observation Dependencies After @Observable

Swapping ObservableObject for @Observable is a one-afternoon change. Figuring out which views still repaint for no good reason is the part nobody puts in the ticket. Here's the audit loop we run on every screen that feels heavier than it should.

Canceled but Still Charged? A StoreKit 2 Entitlement Audit That Saves Support Tickets
Testing & Tooling

Canceled but Still Charged? A StoreKit 2 Entitlement Audit That Saves Support Tickets

Subscription support tickets rarely start with a billing bug. They start with an app that tells a slightly different story than StoreKit. Here is a practical StoreKit 2 audit for Swift teams who want entitlement state to stop lying before the inbox fills up.

Picking a Local Store You Won't Regret: SwiftData and GRDB for Offline-First Apps
Swift Architecture

Picking a Local Store You Won't Regret: SwiftData and GRDB for Offline-First Apps

SwiftData and GRDB both keep data on device, but they fail in different ways once queries get weird, sync goes sideways, and migrations land on a Friday. Here is a practical decision matrix built around production constraints instead of synthetic benchmarks.

The Silent Stall: Auditing BGTaskScheduler Before Users Notice Stale Data
Testing & Tooling

The Silent Stall: Auditing BGTaskScheduler Before Users Notice Stale Data

Background refresh works great on your desk and quietly dies in the wild, where users blame the app for stale content. Here's a Swift-native audit of BGTaskScheduler registration, expiration handling, scheduling budgets, and real-device verification that surfaces silent refresh failures before your reviews do.

The Red Dot Doesn't Lie — Except When It Does: Reconciling Notification Badges in Swift
Swift Architecture

The Red Dot Doesn't Lie — Except When It Does: Reconciling Notification Badges in Swift

That little red number is the only part of your product users see without opening anything, and most Swift apps break the promise within a week of launch. Here's how to treat badge state like the distributed system it actually is — and reconcile it before people learn to ignore it.

Crash Logs Don't Fix Themselves: A Weekly MetricKit Triage the Whole Team Can Stomach
Testing & Tooling

Crash Logs Don't Fix Themselves: A Weekly MetricKit Triage the Whole Team Can Stomach

You wired up MXMetricManager, the payloads started landing, and then... nothing. This is a boring, repeatable 30-minute Monday ritual that turns a folder of opaque JSON into a capped list of five fixes with actual names attached to them — plus a small shell script that does the flattening for you.

Dress Rehearsal for SwiftData: Testing Schema Changes on Copies of Real User Stores
Testing & Tooling

Dress Rehearsal for SwiftData: Testing Schema Changes on Copies of Real User Stores

A schema change is a database deployment hiding inside an app update. Here's the rehearsal workflow we run before shipping SwiftData migrations: snapshot real store files, replay lightweight and custom stages, time the whole thing, and find the exact point where a rollback stops being an option.

Paper Trail, Not Bug Hunt: Preflighting Privacy Manifests in Swift Dependencies
Testing & Tooling

Paper Trail, Not Bug Hunt: Preflighting Privacy Manifests in Swift Dependencies

Most App Store rejections in 2026 are not clever bugs; they are missing declarations buried inside dependency checkouts. Here is a repeatable Swift preflight that scans packages for required reason APIs, maps each hit to a manifest entry, and fails CI before upload.

The Dynamic Island Is Lying to You: A WidgetKit Refresh Audit That Finds the Real Lag
AI & Performance

The Dynamic Island Is Lying to You: A WidgetKit Refresh Audit That Finds the Real Lag

Your home-screen widget and Live Activity are probably not late — they are being throttled, and your code may be asking for the wrong cadence. Here is a developer-first audit that measures real refresh delivery, exposes wasted budget, and turns update policy into something you can defend in review.

Hard-Coded Hex and Rogue Padding: Auditing Your SwiftUI Design System Before the Redesign Lands
Swift Architecture

Hard-Coded Hex and Rogue Padding: Auditing Your SwiftUI Design System Before the Redesign Lands

Your colors and spacing stopped being a system a long time ago — now they're an undocumented API that every view quietly depends on. Here's a five-step audit that turns scattered hex codes and magic numbers into semantic tokens you can actually deprecate before the next redesign turns into a screen-by-screen scavenger hunt.

Simulator Says Yes, iPhone Says Yikes: Seven Device-Only Swift Performance Tests
Testing & Tooling

Simulator Says Yes, iPhone Says Yikes: Seven Device-Only Swift Performance Tests

Your Mac is not an iPhone, and the Simulator knows it. These seven lightweight tests expose the memory, thermal, camera, networking, background, GPU, and sensor behavior that only shows up on real hardware, plus what to record so your team argues with evidence instead of vibes.

AI & Performance

Your App's First 400ms Are a Crime Scene: Triage Launch Time Before You Refactor

Inherited a large Swift codebase where launch feels slow, but nobody wants to gamble on a rewrite? Start with measurement. This is a practical triage plan for pre-main cost, dynamic linking, Swift runtime setup, and eager work that can move behind the first frame.

Feature Flags Without the Baggage: A Swift-Native Rollout Layer
Swift Architecture

Feature Flags Without the Baggage: A Swift-Native Rollout Layer

Feature flags should reduce release risk, not become permanent tech debt. Here is a minimal, dependency-free Swift architecture for gradual rollouts, kill switches, and remote overrides—plus the testing and cleanup guardrails that keep it honest.

Ten SwiftUI Accessibility Checks You Can Run Before Lunch
Testing & Tooling

Ten SwiftUI Accessibility Checks You Can Run Before Lunch

Accessibility bugs rarely fail the build. They fail real people—and sometimes show up in legal complaints. Here are ten SwiftUI checks any iOS engineer can run in an afternoon with Xcode, a simulator, and zero extra SDKs.

Your Deep Link Works Until It Doesn’t: Seven SwiftUI Navigation Patterns to Audit Now
Swift Architecture

Your Deep Link Works Until It Doesn’t: Seven SwiftUI Navigation Patterns to Audit Now

Deep links rarely fail in the happy path. They fail after a user signs in, switches tabs, or returns from a sheet—and SwiftUI’s navigation stack is often the culprit. Here are seven screen patterns worth auditing in 2026, with fixes you can ship.

I Migrated 50K Lines From XCTest to Swift Testing: The Wins, the Scars, and the Call I’d Make Today
Testing & Tooling

I Migrated 50K Lines From XCTest to Swift Testing: The Wins, the Scars, and the Call I’d Make Today

A first-hand account of moving a large production iOS codebase from XCTest to Swift Testing, including the parts that got faster, the parts that broke, and the hybrid setup I’d recommend to most US teams in 2026.

Where Did the Sprint Go? A One-Week Build-Time Audit for Swift Teams
AI & Performance

Where Did the Sprint Go? A One-Week Build-Time Audit for Swift Teams

Build times are a tax on every sprint, and most Swift teams pay it without checking the bill. This one-week audit shows how to measure Xcode and Swift Package Manager builds, find the seven usual suspects, and fix the ones that actually move the needle.

Plain Structs, Clear Code: The Case Against Clever Swift Architecture
Swift Architecture

Plain Structs, Clear Code: The Case Against Clever Swift Architecture

Every Swift codebase has a moment where a simple feature needs a map to trace. This opinion piece argues for fewer protocols, lighter dependency injection, and plain structs that make the next engineer's Tuesday easier.