Snapp iOS Weekly
Hi folks,
Good boundaries make our work easier to reason about, whether that means putting data on the right enum case, keeping actor isolation clear, or choosing the SwiftUI scroll API that does just enough. This week also brings better ways to search Apple’s documentation, a research skill for coding agents, and a small test-helper change worth checking before the next CI cache miss.
Have fun!
Articles
Swift
Associated Values: Put Data Where It Belongs
A pile of optional properties can make a simple state model surprisingly hard to trust. Swift enum associated values let us keep the relevant data with each case, so a queued delivery can’t accidentally have a recipient attached. The useful caveat: that protects the shape of our data, not every value inside it. We still need validation for things like an out-of-range percentage, and a separate API if state transitions matter.
Key Paths in Swift
Key paths give us a type-safe way to pass around a property without passing around its value. The examples move from map(\.name) to reusable sorting and writable settings, with a handy rundown of the different key path types. I like the restraint here: when an operation needs real logic, a closure is often the clearer choice.
Revisiting “Split Isolation”
A class with a few @MainActor methods can look harmless until a task tries to carry its non-Sendable state across an actor boundary. “Split isolation” gives that awkward design a name and explains why the compiler complains where older GCD code might have left us to discover the race ourselves. Making the whole type @MainActor is one option, though the discussion also makes room for cases where mixed isolation is perfectly reasonable.
AI / ML
Apple Research Skill
Coding agents can be very confident about an Apple API that doesn’t exist. Apple Research Skill asks them to check documentation, WWDC sessions, release notes, and the HIG before planning or writing code. It produces a sourced report with open questions and marks unverified claims and inferences, then stops for review. That pause sounds useful when our deployment targets and SDK availability actually matter.
Cupertino 1.6: Platform Filters, Apple’s Tutorials, and One Search Engine
Cupertino’s Apple documentation search now lets us filter by an exact set of platforms or a UI toolkit, and Apple’s tutorials have joined the index. The release notes also dig into a migration that initially left new metadata empty, plus changes to keep searches from modifying the databases they read. It’s a refreshingly candid look at the messy details behind a better search tool, whether we use its CLI or MCP interface.
UI / UX
What is GlassEffectContainer in SwiftUI and how to use it
Separate Liquid Glass views don’t automatically know about one another. Wrap them in GlassEffectContainer, though, and they can blend and morph together while the system draws them as a group. The examples show how spacing, glassEffectUnion, and IDs affect the result—handy when a toolbar needs to feel like one interface rather than a collection of shiny bubbles.
Scroll-driven effects in SwiftUI: phases, geometry and scroll state
SwiftUI has several ways to react to scrolling, and picking the smallest one can save us a lot of unnecessary state updates. Use scrollTransition for effects as views enter and leave, visualEffect for position-based effects like parallax, and geometry or visibility callbacks when other parts of the interface need to react. The carousel examples make those trade-offs much easier to see.
Testing
#file vs #filePath in Swift Tests - Cleaner, Cacheable Builds
Absolute source paths can sneak into our test binaries through helper defaults. For messages that only need a file identifier, #fileID avoids tying those strings to a particular checkout and may help shared build caches—though other sources of path variation still matter. Keep #filePath where a real path is needed, including XCTest failure forwarding and source-relative fixtures; Swift Testing has SourceLocation for its own helpers. One detail worth remembering: #file is concise by default in Swift 6 language mode, not necessarily Swift 5.