In this post we will explore the most modern APIs that SwiftUI provides for programmatic scrolling, covering how to configure the initial scroll position of a scroll view, how to drive it programmatically, and how to read the current position back. We will also cover some of the nuances that are easy to miss. It's worth noting though, that all of these new APIs apply to ScrollView only, and ScrollViewReader remains the only native option for programmatic scrolling in lists.
The Observation framework is a modern Swift feature that provides automatic change tracking for observable objects. It replaces ObservableObject with a cleaner, more efficient approach using Swift macros.
I built a sample app for this post called Tour Merch. It’s an App Clip plus a parent app, both written in Swift 6 with strict concurrency on. The clip lets you buy a shirt at a Metallica show with Apple Pay; the parent app lets you see every shirt you’ve bought across the tour. The whole companion repo is at the end of this post if you want to clone and poke.
What I want to walk through is the stuff that matters once you sit down to build one of these: what App Clips are actually for, how invocation works, how the project is wired, where Apple Pay forces your hand under Swift 6, and how the clip hands off to the parent app without losing the receipt.
Feature flags are a foundational tool for modern mobile development. They allow teams to control behavior at runtime, roll out features gradually, run experiments, and decouple deployment from release. In iOS applications, a well-designed feature flag system also becomes a central coordination mechanism between product, QA, and engineering.
This article walks through a type-safe and thread-safe feature flag implementation in Swift. It explains the design decisions behind the approach, the problems it solves, and how to integrate it into a real application.
SwiftUI provides built-in support for animations. In many cases, adding animations only requires attaching an animation to a state change.
There are two common ways to do this:
In this article, we'll look at how both approaches work and when to use each of them.
Text recognition using Apple's Vision framework. The article compares the old API (VNRecognizeTextRequest with VNImageRequestHandler, synchronous perform, completion handlers) and the modern API introduced in iOS 18 and macOS 15 (RecognizeTextRequest, Swift native, Sendable, async/await). The modern version is cleaner: configure the request as a value type, call try await request.perform(on: image), get observations, extract top candidates. The article also covers recognition levels (.accurate vs .fast), language detection (automatic or manual), multi line documents, and the newer RecognizeDocumentsRequest for paragraphs instead of lines.
A deep dive into Apple's standardized component for empty, unavailable, or failed content states. Before iOS 17, every app built the same VStack with an icon, title, description, and button. ContentUnavailableView provides a canonical system component with platform consistent styling, accessibility defaults, and Dynamic Type support. The article covers basic usage with title and systemImage, the built in search variant (ContentUnavailableView.search), custom initializers with view builders for actions (like a retry button for network failures), real world production examples (failed requests, first time UX, empty invoices), accessibility considerations, state driven patterns with enum based loading states, common mistakes (overbuilding, generic messages, missing recovery actions, showing empty state during loading), and when not to use it (onboarding, paywalls, interactive tutorials).
Building an event bus for communication between loosely coupled parts of an app. The implementation focuses on type safety (events conform to a marker protocol), thread safety with NSLock, automatic cleanup when the subscriber is deallocated, explicit cancellation via SubscriptionToken, MainActor delivery for UI code, and AsyncStream support. The key design choice is that subscriptions follow the owner's lifetime (weak reference), not the token's. The bus cleans up dead subscriptions lazily during publish or subscribe operations. Publishing creates a snapshot of subscribers and delivers events synchronously outside the lock.
A detailed breakdown of five core SwiftUI gestures. TapGesture with count and coordinateSpace parameters. LongPressGesture with minimumDuration, onPressingChanged, and maximumDistance. DragGesture with .onChanged, .onEnded, and an advanced version using .updating with @GestureState, explaining value, state, and transaction parameters. MagnifyGesture with magnification and velocity. RotationGesture using two @State properties (currentAngle and finalAngle) to preserve rotation after the gesture ends. A separate section on gesture composition: .map for transforming data, .simultaneously for parallel execution (unwrapping optional .first and .second), and .sequenced for sequential gestures (switch statement on the enum).
A straight introduction to SwiftData, Apple's persistence framework for iOS 17. You will see how to define models with @Model, set up a model container, fetch data with @Query, insert and save via modelContext, filter with #Predicate, and link models with @Relationship. The code is minimal and clean.
Are you tired of Ruby and Fastlane installation issues? There's got to be a better way! Discover Codemagic open source CLI tools. It is not a drop-in replacement for all of what Fastlane does (screenshots for example), but we use it at Codemagic to build and publish iOS and Android apps, also versioning and device provisioning.