All posts

Posts tagged with: Swift

169 posts found

A row of glass test tubes in a rack on a laboratory bench
Swift Swift Testing

Swift Wants Your Tests in the Same File as Your Code. The Hard Part Is Keeping Them Out of Your Binary.

A new Swift Testing pitch, 'Colocated Tests', lets a SwiftPM library target hold @Test functions right next to the code they test, including access to private members. Here's how the proposed @available(Testing) domain keeps test code out of release builds, the open questions on build times and linking, and what it means for iOS app projects.

8 min read
Close-up of printed calendar pages with rows of dates
Swift Foundation

Calendar.current Isn't Always Gregorian. In Thailand, It's the Year 2569.

Calendar.current follows the user's chosen calendar, so on a phone set to the Buddhist or Japanese calendar, component(.year) returns 2569 or 8 instead of 2026. Here's how that breaks card expiry checks, age gates, filenames, and date math in Swift apps, and how to fix it with an explicit Gregorian calendar.

9 min read
A Polaroid camera resting on top of a scattered pile of instant photos
Swift Swift Evolution

Your Actor Can't Be @Observable. A New Swift Pitch Wants to Fix That With Snapshots.

Today '@Observable' refuses to touch an actor, and a SwiftUI view can't await an actor's state anyway, so we all hand-write a main-actor mirror class. A new Swift Evolution pitch proposes observable actors plus a synthesized, nonisolated 'latestSnapshot' that views can read synchronously. Here's what it changes, the consistency model, and what to do until it ships.

8 min read
A door standing half open in a dark room with red light spilling through the gap
Swift Foundation

URL(string:) Stopped Returning nil for Garbage in iOS 17. Your Validation Still Trusts It.

Since iOS 17, URL(string:) percent-encodes invalid characters instead of returning nil, so 'guard let url = URL(string: input)' accepts almost any text as a valid URL. Here's what changed, why it only kicked in when you updated Xcode, and how to validate URLs properly in Swift with scheme and host checks and URL(string:encodingInvalidCharacters:).

9 min read
A ring of old iron keys hanging from a nail on a weathered wooden wall
Swift SwiftPM

SwiftPM Wants to Stop Storing Publish Tokens in CI. Your App Store Connect Key Is the Same Problem.

A new Swift forums pitch adds trusted publishing to SwiftPM: short-lived OIDC tokens instead of long-lived registry credentials. Here's how the token exchange works, the wildcard bug the pitch warns about, and what iOS developers should do today about the App Store Connect API key sitting in their CI secrets.

8 min read
A red vintage tram on a snowy Istanbul street with pedestrians walking past
Swift Foundation

You Shipped a Turkish Localization. Now "INFO" Lowercases to "ınfo" and Your String Matching Is Broken.

localizedLowercase and lowercased(with: .current) follow Turkish casing rules, where I lowercases to dotless ı and i uppercases to dotted İ. Here's how that breaks enum parsing, email normalization, file extensions and dictionary keys in Swift apps, why it only shows up after you add a Turkish localization, and the rule that fixes it.

8 min read
A stack of paper documents and folders piled on a desk
Swift Foundation

FileManager Says Your File Doesn't Exist. It's Right There. URL.path() Added %20 to the Name.

URL.path() returns a percent-encoded path by default, so FileManager.fileExists(atPath:) returns false for any file with a space or an accent in its name. Here's why path() and the old path property disagree, how it silently creates duplicate files, and how to fix file URL handling in Swift for good.

8 min read
Close-up of a red wax seal pressed onto a folded paper envelope
Swift Codable

Your Request Signature Fails on One Request in Ten. JSONEncoder Never Promised You the Same Bytes.

Signing a JSON body with HMAC in Swift breaks when you encode twice, when a Dictionary changes key order, or when JSONEncoder escapes slashes as \/. Here's why JSONEncoder output isn't canonical, how it breaks webhook and API signatures, and the fix: sign the exact Data you send.

9 min read
A pile of pastel paper labels, each with a different handwritten name
Swift Strings

Your Cache Key Says "user-Optional(42)". Swift String Interpolation Wrote It, and Xcode's Fix-It Made It Permanent.

Interpolating an optional into a Swift string produces "Optional(42)" or "nil", not the value. Here's how that ends up in URLs, cache keys, file names and analytics events, why Xcode's String(describing:) fix-it silences the warning without fixing the bug, and how to make optionals in strings impossible to ship.

9 min read
Green binary code digits glowing on a dark computer screen
Swift Foundation

Your Binary Parser Passed Every Test. Then data[0] Crashed in Production Because the Slice Started at 4.

In Swift, a Data slice keeps the indices of the original buffer. After dropFirst, prefix(upTo:) or a range subscript, data[0] is out of bounds and crashes. Here's why Data is its own SubSequence, why tests built from fresh Data never catch it, and how to write byte parsers that work on any slice.

9 min read
Close-up of a calculator keypad with number keys
Swift SwiftUI

Your Digits-Only TextField Accepts "½". Then Int() Returns nil and the Save Button Does Nothing.

Swift's Character.isNumber is true for ½, Ⅻ, Arabic-Indic and full-width digits, but Int(String) only parses ASCII 0-9. Here's how a numeric TextField filter lets input through that your parser silently rejects, plus the isWholeNumber, ASCII-only and locale-aware fixes, Regex asciiOnlyDigits(), and the tests that catch it.

8 min read
A plain cardboard box with no label sitting alone on a wooden floor
Swift Codable

Your Backend Added One Enum Case. Every User on the Old App Build Got an Empty Screen.

A Swift enum with a String raw value and synthesized Codable throws on any value it doesn't know, and that one throw takes down the whole object and the whole array around it. Here's how a harmless server-side addition empties your iOS app, the unknown-case and other(String) fixes, the encode-back trap, and the test that catches it before the App Store does.

9 min read
Rows of identical umbrellas in repeating colors hanging against a gray sky, each one indistinguishable from its twins
SwiftUI Swift

ForEach(items, id: \.self) Works Until Two Items Are Equal. Then SwiftUI Deletes the Wrong Row.

Using id: \.self in a SwiftUI ForEach or List makes the value itself the row's identity. Duplicate values, edited structs, and ForEach over indices all break that promise, causing wrong-row deletes, reset @State, lost TextField focus, and index-out-of-range crashes. Here's why, and the stable-ID fix.

9 min read
A red 'Road Ahead Closed' sign standing on a city sidewalk at night
Swift Networking

Your Base URL Has No Trailing Slash. URL(string:relativeTo:) Just Deleted Your /v2.

URL(string:relativeTo:) follows RFC 3986, so a base URL like https://api.example.com/v2 without a trailing slash quietly drops /v2 when you resolve an endpoint against it, and a leading slash on the endpoint drops the whole path. Here's why every request suddenly 404s, the xcconfig // comment trap that truncates your base URL, the URL equality and Codable surprises of relative URLs, and a safe join helper with a test.

8 min read
A paper wall calendar with a grid of days, one square per date
Swift Foundation

You Saved the User's Birthday as a Date. Now It's a Day Early for Everyone in America.

A birthday, due date, or all-day deadline is a calendar day, not a moment in time. Storing it as a Swift Date pins it to midnight in one time zone, so it shifts by a day when the user travels or when your server parses "1990-03-05" as UTC. Here's why it happens, the LocalDate struct that fixes it, the noon hack that almost works, and the test that proves it.

9 min read
A small cafe storefront with its name painted on a sign above the door
Swift SwiftUI

Your Search Bar Can't Find "Café" When the User Types "cafe". String.contains Is Exact.

Filtering a SwiftUI list with String.contains or lowercased().contains misses accents, and users don't type accents. Here's why "cafe" never matches "Café", the difference between localizedCaseInsensitiveContains and localizedStandardContains, how to do it in SwiftData #Predicate, how to keep big lists fast, and the test that catches it.

9 min read
A close-up of an analog clock face with its hour and minute hands
Swift Foundation

Your Date Parsing Works on Every Test Device. Then One User Turns Off 24-Hour Time.

A fixed-format DateFormatter in Swift respects the user's 12/24-hour override, so a perfectly good server timestamp can come back nil for a handful of users. Here's why Apple's QA1480 bug still bites iOS apps, why en_US_POSIX is the fix, the time zone trap hiding next to it, and how to switch machine dates to ISO8601FormatStyle.

8 min read
A light switch mounted on a wall
Swift Foundation

UserDefaults.bool(forKey:) Returns false for a Key You Never Set. Your 'On by Default' Setting Ships Off.

UserDefaults.bool(forKey:) can't tell 'the user turned this off' from 'nobody has ever touched this', so every setting that's supposed to default to true quietly starts as false. Here's why, how register(defaults:) fixes it, why the @AppStorage inline default only fixes it for one view, and the widget and first-launch traps sitting right next to it.

9 min read
A printed document with several lines blacked out by a heavy marker
Swift Strings

String(decoding:as:) Never Fails. It Just Quietly Swaps Your Bytes for �.

Swift has two ways to turn bytes into a String and they disagree about failure: String(data:encoding:) returns nil on invalid UTF-8, String(decoding:as:) repairs it with U+FFFD and never tells you. Here's where broken bytes actually come from on iOS (chunked streams, Latin-1 files, BLE packets), how the repair corrupts hashes and signatures, Swift 6's String(validating:as:), and a chunk-safe decoder.

10 min read
A close-up of a mechanical odometer with its digits mid-roll
Swift iOS Development

Swift Integers Don't Wrap. They Crash. And UInt Crashes the Moment You Subtract One From Zero.

Unlike C, Swift traps on integer overflow in release builds too. Here's the arithmetic-overflow crash in a progress bar, the UInt subtraction that can't go below zero, the UInt8(doubleValue) conversion that dies at 256.0, the Y2038 bug compiled into Int32(timeIntervalSince1970), the wrapping operators that hashes and PRNGs actually need, and the reporting and clamping APIs that replace the guesswork.

10 min read
A railway junction where one track splits into two, seen from above the switch
Swift SwiftPM

Package.swift Can't Tell the Simulator From a Real iPhone. A New SwiftPM Pitch Finally Fixes That.

SwiftPM's .when(platforms:) condition matches the OS, so a package manifest can't link one library for the iOS simulator and another for the device. A new Swift Evolution pitch adds target environment conditions to Package.swift. Here's what it fixes, the workarounds it replaces, and the one naming fight the thread is already having.

10 min read
A large clock tower face seen from below against a pale sky, hands frozen mid-afternoon
Swift iOS Development

Adding 86,400 Seconds Isn't Adding a Day. Twice a Year Your Streak Counter Finds Out.

A day isn't always 86,400 seconds long. Daylight saving transitions make it 23 or 25 hours, which quietly breaks streak counters, 'last 7 days' queries, and repeating reminders. Here's why Calendar exists and how to do date math that survives March.

7 min read
A long line of people waiting in a queue, stretching back into the distance
Swift iOS Development

Your Queue Is Quadratic. Array.removeFirst() Moves Every Element, Every Single Time.

Swift's Array.removeFirst() is O(n), so using an Array as a FIFO queue turns BFS, flood fill, and job queues quadratic. Here's the math, the head-index fix, Deque from swift-collections, and when removeFirst is actually fine.

9 min read
Close-up of paper calendar pages with printed dates
Swift iOS Development

JSONEncoder Sends Your Dates as Seconds Since 2001. Your Backend Thinks It's 1995.

Swift's JSONEncoder defaults to .deferredToDate, which encodes Date as a Double counting seconds from January 1, 2001, not 1970. Here's why round-trip tests never catch it, what it does to Node, Python and Go backends, and how to pin one date strategy for your whole app.

8 min read
A heap of ornate antique brass keys piled on top of each other, many of them nearly identical
Swift iOS Development

Dictionary(uniqueKeysWithValues:) Is a Promise. One Duplicate ID From Your Backend and Your App Crashes.

Swift's Dictionary(uniqueKeysWithValues:) traps on a duplicate key, in release builds too. Here's how one repeated ID from an API crashes your iOS app, the uniquingKeysWith and grouping fixes, Unicode keys that collide, and SwiftUI ForEach's duplicate-ID cousin.

9 min read
Discarded paper thrown away in a waste bin, like an error swallowed by try?
Swift iOS Development

guard let try? Is a Neuralyzer for Your Errors. Swift's New guard do/catch Pitch Wants to Fix It.

guard let x = try? throws away the error, so a renamed JSON key becomes a silent empty screen. Here's what try? really hides in iOS apps (decoding failures, nil vs thrown, Task.sleep cancellation loops), the do/catch pattern that keeps the error without nesting today, and what the guard do ... catch Swift Evolution pitch proposes.

9 min read
A calculator resting on printed receipts and financial paperwork on a desk
Swift iOS Development

Your Receipt Says $0.13. Your Label Says $0.12. Swift Has Two Rounding Rules and You're Using Both.

Swift's Double.rounded() rounds half away from zero, but NumberFormatter, FormatStyle, and String(format:) round half to even. Here's why the same number displays two ways, the 1.005 trap, and how to pick one rounding rule and enforce it.

8 min read
A spreadsheet with rows and columns of numbers on a screen
Swift iOS Development

Swift's split() Throws Away Your Empty Fields. Your CSV Import Just Shifted Every Column Left.

Swift's split(separator:) omits empty subsequences by default, so a,,c becomes two fields, not three. Here's how that shifts CSV and TSV columns, why Windows CRLF line endings never split on a newline, how components(separatedBy:) differs, and the safe way to parse delimited lines.

8 min read
Close-up of a calculator with its display showing an error instead of a number
Swift iOS Development

One NaN Got Into Your Array. Now sorted(), contains(), and Set Are All Quietly Lying.

Double.nan isn't equal to itself, so one NaN silently breaks Swift's sorted(), contains(), firstIndex(of:), max(), Set and Dictionary, and even your clamp function. Where NaN comes from in iOS apps, why it spreads, and how to stop it at the boundary.

9 min read
A wall of brass post office boxes, one standing open and empty among the closed doors
Swift iOS Development

Codable Can't Tell You the Difference Between null and a Missing Key. Your PATCH Endpoint Can.

decodeIfPresent collapses an explicit JSON null and an absent key into the same nil, which makes 'clear this field' and 'leave it alone' indistinguishable. Here's the three-state wrapper that keeps them apart, and when you actually need it.

7 min read
Rows of small wooden library card catalog drawers, each labeled for a range of the alphabet
Swift iOS Development

Your List Sorts "Track 10" Before "Track 2" and "Zebra" Before "apple". Swift's < Isn't Alphabetical.

Sorting user-facing strings with < in Swift compares Unicode scalar values: uppercase before lowercase, accented letters at the end, and numbers digit by digit. Here's how localizedStandardCompare, compare(options:locale:) and KeyPathComparator fix it, and when you should keep using <.

8 min read
A green car side mirror printed with the warning 'Objects in mirror are closer than they appear'
Swift iOS Development

One Invisible Character Makes Your App's Text Run Backwards. SE-0559 Finally Lets Swift See It.

U+202E RIGHT-TO-LEFT OVERRIDE can flip usernames, notification text, and file names like invoice_exe.pdf in any iOS app. Here's how bidi spoofing works, how to strip and isolate user text in Swift today, and what SE-0559's new Unicode.BidiClass adds.

10 min read
A yellow tape measure pulled out across a surface, its markings counting off units
Swift iOS Development

Your @Mention Highlight Drifts After Every Emoji. NSRange Doesn't Count What String.count Counts.

String.count counts characters, NSRange counts UTF-16 code units, and mixing them shifts every highlight, regex match, and text field limit after the first emoji. Here's why, and the two initializers that fix it.

9 min read
A vintage ink bottle resting on an old postmarked envelope with a handwritten address
Swift iOS Development

URLComponents Leaves the + in Your Query Alone. Your Server Reads It as a Space.

URLComponents.queryItems percent-encodes spaces and ampersands but leaves + untouched, and most servers decode + as a space. Here's why mario+test@gmail.com arrives as 'mario test@gmail.com', and the one-line fix.

7 min read
A paper calendar page with dates and a pen resting on it, ready for a new year of plans
Swift iOS Development

Your DateFormatter Says It's Next Year. Capital YYYY Isn't the Year You Think It Is.

In a DateFormatter pattern, YYYY is the week-based year, not the calendar year. For a few days around New Year it prints the wrong year, breaking receipts, filenames, cache keys, and API payloads. Here's why, which dates it hits per locale, and how to catch it before December does.

9 min read
A scattered pile of coins on a table, the kind of small change a rounding error is made of
Swift iOS Development

You Switched Your Prices to Decimal. Decimal(0.1) Still Went Through a Double First.

Swift's Decimal fixes binary floating-point money bugs, until you build one from a Double or a float literal. Here's why Decimal(0.1) can carry the exact error you were trying to escape, and the initializers that actually give you exact cents.

8 min read
A tray of metal letterpress type blocks, capital and lowercase letters sorted side by side
Swift iOS Development

Swift's uuidString Is Uppercase. Your Backend's UUIDs Aren't. Every String Comparison Between Them Fails.

UUID().uuidString returns uppercase hex while Postgres, JavaScript and Python emit lowercase, so string comparisons, dictionary keys, cache file names and Set deduplication silently miss. Here's where it bites in iOS apps and how to keep UUIDs typed until the boundary.

8 min read
Close-up of a round clock face with numbers arranged in a circle, the kind of wraparound that modular arithmetic is supposed to model
Swift iOS Development

Swift's % Isn't Modulo. -1 % 7 Is -1, and Your Carousel Just Crashed.

Swift's % operator is a remainder, not a modulo: its result takes the sign of the left-hand side, so -1 % 7 is -1, not 6. Here's why wraparound indexes crash on the back button, why Double has no % at all, and the one-line helper that fixes it.

8 min read
A deck of playing cards scattered across a table in no particular order
Swift iOS Development

Your Set Iterates in a Different Order Every Launch. That's Not a Bug, It's a Security Feature.

Swift randomizes its hash seed on every process launch, so Set and Dictionary iteration order changes between runs. Here's why that exists, the three places it silently breaks your app, and how to get stable order without giving up the hash table.

7 min read
Shipping containers stacked tightly together in a port, packed with no wasted space between them
Swift Performance

Swift Never Reorders Your Struct's Fields. Move One Line and Your Array Gets a Third Smaller.

Swift lays out stored properties in declaration order and never rearranges them, so a Bool declared before an Int64 silently costs 8 bytes of padding per element. A new Swift Evolution pitch wants the compiler to warn you. Here's the mechanism, the real numbers, and what to do about it today.

9 min read
A row of empty theater seats, each with a small brass number plate
Swift Collections

enumerated() Gives You an Offset, Not an Index. On a Slice Those Are Different Numbers.

for (i, item) in collection.enumerated() reads like it hands you an index, and on a plain Array it happens to. Feed it an ArraySlice and the same loop crashes with Index out of range. Here's the distinction Swift is actually drawing, and the two fixes.

5 min read
A precision vernier caliper measuring a small component, jaws closed on a fine measurement
Swift iOS Development

Your Date Decoding Worked for a Year. Then the Backend Added Milliseconds.

JSONDecoder's .iso8601 date strategy rejects fractional seconds, so the day your API starts sending 2026-10-05T09:31:00.482Z every request fails to decode. Here's why the strict parser exists and the custom strategy that handles both shapes.

5 min read
A closed shop at night with the interior lights still burning
Swift Concurrency

@MainActor on Your Class Does Not Cover deinit. That's Where Your Last Data Race Lives.

You marked the whole class @MainActor, the compiler went quiet, and you assumed every member was protected. deinit isn't. It runs wherever the final release happens, which can be any thread — and Swift will happily let you touch main-actor state from it.

6 min read
A container ship loaded only halfway, the rest of the deck empty
Swift Swift Evolution

SwiftPM Compilation Caching Is Accepted. The Part Your CI Actually Needed Got Cut.

SE-0547 landed today, accepted with modifications: the remote cache configuration was removed before acceptance. Local caching is real and it's good. But the shared cache that would make your clean CI builds fast got deferred to a future proposal.

8 min read
A stack of envelopes with handwritten addresses, one marked as returned to sender
Swift iOS Development

Your Saved File Paths Break When the User Gets a New iPhone. The Files Never Moved.

Storing an absolute file URL in your database works perfectly until a device restore or iCloud sync hands your app a new container path. Here's why the bug survives every test you run, and how to store paths that keep working.

7 min read
A wall of numbered wooden pigeonholes in an old postal sorting office
Swift SwiftUI

Every @Observable Mutation Builds a Key Path. Even the Ones Nobody Is Watching.

A new Swift pitch for Observation puts real numbers on something most of us never measured: mutating an unobserved property of an observed object costs 70-115ns, almost all of it key path formation and lock contention. The proposed fix is a small integer. Here's the mechanism, and the part of the pitch I'd actually use tomorrow.

8 min read
A deck of playing cards spread and shuffled across a surface
Swift iOS Development

Swift's sorted() Makes No Promise About Equal Elements. Your List Reshuffles for Free.

Swift's sort is not documented as stable, so two elements that compare equal can swap places between runs. Here's why that silently breaks SwiftUI list animations and paginated APIs, and how to make your sort total instead of hoping for the best.

6 min read
The brass pendulum and gears of an old clock mechanism, stopped mid-swing
iOS Development Swift

Your Timer Stops Every Time the User Scrolls. Timer Is Working Exactly as Documented.

A scheduled Timer silently stops firing the moment a user touches a scroll view, because scheduledTimer adds itself to the run loop's default mode and scrolling switches to tracking mode. Here's the mechanism, and why reaching for .common isn't automatically the right fix.

6 min read
A marionette puppet suspended on strings, controlled from above by someone out of frame
iOS Development Swift

Your Crash Rate Doubled Overnight. You Didn't Ship Anything.

A third-party SDK can crash your already-shipped iOS app without you releasing a single line of code. Here's the mechanism behind server-driven SDK crashes, why pinning your dependency versions doesn't protect you, and the kill switch you need to ship before you need it.

9 min read
A photocopier machine mid-copy
Swift Value Semantics

Array(repeating:) Looks Like It Makes Five Objects. It Makes One, Five Times.

Array(repeating:count:) copies its value into every slot — which is exactly why it silently breaks the moment that value is a class instance. Here's the reference-sharing bug and how to actually get five independent objects.

5 min read
Close-up of a typewriter with a sheet of paper, mid-sentence
SwiftUI Swift

Your Username Has an Underscore. SwiftUI Just Rendered Half of It in Italics.

AttributedString and Text(_:) both parse Markdown by default in SwiftUI. That's great for your own copy and a landmine for anything that echoes user-generated text back onto the screen. Here's the actual fix.

5 min read
A microphone close to a speaker, the setup that causes audio feedback loops
SwiftUI Swift

SwiftUI's Purple Warning Isn't Cosmetic. 'Publishing Changes From Within View Updates' Means You Raced Your Own Render.

Xcode's console warns 'Publishing changes from within view updates is not allowed, this will cause undefined behavior' and most developers just scroll past it. Here's what SwiftUI is actually telling you, the three common ways you trigger it, and why ignoring it eventually costs you a view that won't stop re-rendering.

7 min read
A single slice cut from a whole loaf of bread
Swift Memory Management

ArraySlice Doesn't Give You a Piece of the Array. It Gives the Whole Array a Reason to Stay Alive.

ArraySlice and Substring look like lightweight, independent copies of part of a collection, but they hold a reference to the entire original storage. Here's the real memory-retention bug that causes, and how ~Escapable and Span are about to make it a compile-time guarantee instead of a docs warning.

6 min read
A pile of euro coins next to a receipt
Swift Localization

String(format: "%.2f", price) Works Perfectly on Your Phone. It Breaks the Moment Someone's Set to German.

String(format:) and Double(String) both quietly assume a decimal point. Set your device region to Germany, France, or half of Europe and that assumption flips to a comma — and your price parsing breaks in ways your test suite never sees.

6 min read
Two people sharing one umbrella in the rain
Swift Value Semantics

Your Struct Looks Like It Copies When You Assign It. If It Wraps a Class, It Might Just Be Sharing.

Array gets copy-on-write for free because it checks isKnownUniquelyReferenced before every mutation. Build your own struct around a class-based buffer without that check, and 'independent copies' quietly become one shared object.

7 min read
Runners crouched at the starting line of a track, waiting for the gun
Swift Concurrency

Swift's lazy var Looks Like Free Optimization. It's Also a Free Data Race.

lazy var defers a property's initialization until first access — but Swift never promised that first access is safe from two threads at once. Here's what actually happens when it isn't, and how to fix it without giving up the laziness.

6 min read
Close-up of cracked, dry ground splitting apart
Swift iOS Development

You Can Mutate an Object Sitting Inside a Set. Swift Won't Stop You. It Should Terrify You.

Swift's Set and Dictionary assume a value's hash never changes after you insert it. Mutate a class instance that's already stored in one, and the collection silently corrupts — contains() returns false for an object you can see right there when you iterate. Here's why, and how to actually avoid it.

7 min read
Rows of empty library shelving, some sections cleared out
Swift iOS Development

NSCache Looks Like a Dictionary With a Size Limit. It Isn't Promising You That.

NSCache's countLimit and totalCostLimit read like hard caps, but Apple's docs never promise them as guarantees, and eviction can happen for reasons you can't predict. Here's what NSCache actually contracts to do — and the one gotcha that breaks lookups silently.

6 min read
Close-up of a blank identification badge on a lanyard
Swift Concurrency

Every Swift Task Already Has an ID. You Just Couldn't Read It Cheaply.

SE-0553 adds Task.currentID to Swift — a process-unique, never-reused task identifier that costs nanoseconds instead of the 15x-slower withUnsafeCurrentTask dance. Here's why that gap existed and what it unlocks for tracing and logging.

6 min read
A doorway seen from inside a dim hallway, suggesting the same threshold crossed again and again
SwiftUI iOS Development

SwiftUI's .onAppear Doesn't Mean 'First Appearance.' It Means 'Any Appearance.'

onAppear fires every time a SwiftUI view becomes visible again, not just once — including every time you pop back to it in a NavigationStack. Here's why that duplicates network calls and how to fix it with .task(id:) or a one-shot flag.

5 min read
Close-up of a long stretch of string or rope
Swift Performance

Swift's String.count Isn't O(1). It Walks the Whole String Every Time.

Swift's String.count looks like a free property access, but it's not — Unicode-correct grapheme cluster counting makes it O(n). Here's why Swift made that trade, where it actually costs you, and the isEmpty habit that sidesteps most of it.

6 min read
Theatrical comedy and tragedy masks side by side
Swift Protocols

Your Protocol Extension's Default Method Isn't Overridable. It Just Looks Like It Is.

A conforming type can 'override' a protocol extension's default method and still not get called — because Swift picks that method by the variable's static type, not the object's actual type. Here's the static dispatch trap and how to avoid it.

6 min read
A pi symbol written on a chalkboard
Swift Evolution Swift

Float.pi Has Been Slightly Wrong Since 2016. Swift Is Finally Fixing the Rounding.

SE-0552, in active review through October 6, 2026, changes how Float.pi rounds — undoing a Swift 3-era decision to always round toward zero. Here's the actual bit that moves, why it was ever rounded down on purpose, and whether your code needs to care.

6 min read
A single closed door at the end of a long hallway
Swift Concurrency Async Await

A Continuation Can Only Be Resumed Once. Swift Won't Stop You From Trying Twice.

withCheckedContinuation bridges callback-based APIs into async/await, but resuming it twice crashes at runtime and resuming it zero times hangs forever — and the compiler catches neither. Here's the failure shape and the fix.

6 min read
A red rejected stamp mark
Swift Swift Evolution

Someone Pitched 'and' and 'or' for Swift. The Rejection Was Already Written in 2015.

A fresh Swift Forums pitch to replace && and || with and/or got shut down in two replies — pointing to a document that's been saying no since Swift's early years. Here's the real technical reason, not just 'we don't like it.'

6 min read
A tape measure stretched across a wooden surface
SwiftUI Layout

GeometryReader Doesn't Report Your View's Size. It Reports the Size It Forced On Everything Inside It.

GeometryReader looks like a harmless way to read a view's size in SwiftUI, but it's a greedy layout container that overrides its children's sizing — here's the gotcha, and the modern alternatives that avoid it.

6 min read
A red warning light glowing in a dark room
Swift Concurrency

Thread Sanitizer Just Flagged Your Correct Code as a Race. Swift Might Finally Let You Say 'I Know.'

SE-0550 proposes a @noSanitize attribute for Swift functions, letting you opt individual functions out of ASan/TSan instrumentation. Here's the real problem it solves, and the sharp edges it comes with.

6 min read
Close-up of intricate pocket watch gears and mechanisms
Swift Performance

You're Creating a New DateFormatter on Every Cell Scroll. That's the Lag You Can't Explain.

DateFormatter and ISO8601DateFormatter are expensive to initialize — locale and calendar setup included — and creating one inside a loop or a SwiftUI view body is a quiet, common performance bug. Here's the actual cost and the fix.

5 min read
A padlock and chain wrapped around a metal surface
Swift Swift Evolution

Swift's let Never Meant 'Never Changes.' A New Pitch Wants Property Wrappers to Admit It.

A fresh Swift Evolution pitch lets property wrappers live on let declarations, fixing the real Swift 6 strict concurrency error that rejects thread-safe wrappers in Sendable types, static properties, and nonisolated members.

8 min read
Close-up of mismatched mechanical gears, the kind of quiet misalignment that convertToSnakeCase produces on acronym-heavy property names
Swift Codable

Codable's Snake Case Conversion Looks Like Free API Mapping. It Breaks on the First Acronym.

JSONEncoder's .convertToSnakeCase and JSONDecoder's .convertFromSnakeCase promise to erase the naming gap between Swift and your API. They do — right up until a property has an acronym in it, and then they fail silently on Optional fields instead of throwing.

5 min read
A broken metal chain link isolated against a plain background
Swift Codable

One Bad Element in Your JSON Array Can Freeze Your App Forever. Swift Wants to Fix It.

A fresh Swift Evolution pitch adds skip() to UnkeyedDecodingContainer, fixing a real Codable footgun: the 'decode what you can, skip what you can't' loop that looks correct and hangs at runtime.

7 min read
Close-up macro shot of a mechanical stopwatch face
Swift Concurrency

Date() Subtraction Lies to You About Elapsed Time. Swift's ContinuousClock Doesn't.

Measuring elapsed time with Date() subtraction quietly breaks when the system clock changes mid-measurement. Swift's ContinuousClock and Duration fix it — here's the difference and when it actually matters.

5 min read
A tangled knot of rope slowly being untangled into a straight line
Xcode Git

Xcode Finally Admits project.pbxproj Was a Mistake

Xcode 27.2 beta ships an optional JSON-based project format (.xcproj) built to be readable, merge-friendly, and easier for coding agents to edit. Here's what changes, what doesn't, and whether you should flip the switch yet.

7 min read
A row of small brass padlocks on a wooden surface
SwiftUI NavigationStack

NavigationPath Hides Your Routes Behind Type Erasure. Deep Linking Wants Them Back.

SwiftUI's NavigationPath makes heterogeneous navigation stacks easy to push onto — and nearly impossible to inspect, restore, or deep-link into without a Codable detour. Here's the actual trade-off and how to navigate it.

5 min read
A safety net stretched taut, catching something mid-fall
Swift Swift 6.4

Swift 6.4 Lets Your defer Block Await. withTaskCancellationShield Is Why That's Actually Safe.

Swift 6.4 ships async defer (SE-0493) and withTaskCancellationShield (SE-0504) together, finally letting cleanup code make network calls without racing cancellation. Here's what changes and why the pairing matters.

6 min read
A single rope cut cleanly with scissors, the two ends falling apart
Swift Swift Concurrency

Task.detached Isn't Task With Extra Steps. It Throws Away Everything Task Inherited For You.

Task.detached in Swift concurrency looks like a stronger version of Task, but it silently drops actor isolation, priority, and task-local values. Here's what actually breaks, and when detached is genuinely the right call.

5 min read
A brass keyhole in a locked wooden door
Swift Swift Evolution

Your private(set) Property Isn't as Private as You Think. Swift's Memberwise Init Still Lets Anyone Set It.

A fresh Swift Evolution pitch tackles a real gap: struct memberwise initializers ignore private(set) and let callers set properties you meant to protect. Here's the pitch, the pushback, and why the debate matters more than the syntax.

7 min read
A red pen marking corrections on a graded exam paper
AI Agents Coding Agents

A New Benchmark Tested AI Coding Agents on Real Company Codebases. The Winning Score Was 38.8%.

Real-SWE benchmarks frontier coding agents against private, licensed enterprise codebases instead of public GitHub issues. The best model solved four tasks in ten — and the failure data explains exactly why.

7 min read
A factory conveyor belt moving identical boxes down an automated assembly line
AI Agents Swift Package Manager

OpenAI's Agents Quietly Hacked RubyGems. Swift Package Manager Has the Same Design Flaw.

A new report says an OpenAI agent swarm exploited RubyGems' automatic doc-build system for remote code execution and tried to steal API keys — undisclosed for months. Package.swift runs the exact same way.

8 min read
A delivery truck driving at night, headlights on, mid-route
URLSession Networking

Your Upload Doesn't Stop When Your App Gets Killed. It's Not Supposed To.

URLSession background sessions keep uploads and downloads running after iOS terminates your app — but only if you set them up before the crash, not after. Here's the delegate dance nobody reads the docs closely enough to get right.

5 min read
A compass resting on an old map, needle pointing back toward the starting point
React Native Swift

Shopify Just Walked Back Its Biggest Mobile Bet. The Reason Isn't What You'd Guess.

Shopify is rebuilding its React Native apps in Swift and Kotlin, and it's not because React Native failed — it's because coding agents changed the math on building native twice. Here's what actually changed, and what doesn't apply to you.

7 min read
A velvet rope queue barrier stand, the kind used to control who enters one at a time
Swift Concurrency Actors

An Actor Isn't a Lock. It's a Line With a Very Specific Rule About Cutting.

Swift actors guarantee that only one task touches their state at a time — except across every await, where a second task can walk right in. Here's what actor reentrancy actually means and the bug pattern it causes.

7 min read
Interoffice mail trays passing folders up a chain, each one relayed to the next
SwiftUI PreferenceKey

Your Child View Needs to Tell Its Parent Something. A Binding Is the Wrong Tool.

@Binding is great for two-way state you own. It's the wrong tool when a child view needs to report something upward that it doesn't own — a measured size, a scroll offset, a list of anchors. That's what PreferenceKey is actually for.

5 min read
A close-up of an hourglass with sand mid-fall
Swift Concurrency

Your defer Didn't Fire Late. It Fired Exactly on Time — Just Not the Time You Meant

Swift's defer runs at the end of the enclosing scope, not the end of the function. Inside an if/else branch, that difference can silently defeat the cleanup you thought you wrote.

7 min read
A single spotlight beam illuminating an empty stage
SwiftUI iOS Development

@FocusState Looks Simple. Programmatic Focus in SwiftUI Isn't.

@FocusState works great for the demo. Then you add a 'Next' button, a sheet, or a ForEach, and focus starts silently failing. Here's why, and the patterns that actually hold up.

6 min read
Pruning shears cutting a dead branch off a tree
Swift Swift Evolution

Swift Might Get a Compile-Time #if for Your Deployment Target

A fresh Swift Forums pitch proposes #if deploymentTargetAtLeast(...) — a compile-time check tied to your minimum OS version, aimed at killing dead backward-compat branches that if #available can't touch.

7 min read
A brass combination lock dial, close up
Swift SwiftPM

SwiftPM Traits Let You Turn Off Half Your Library. Your Test Suite Has No Idea.

A new Swift Evolution pitch fixes a real gap in SwiftPM package traits: there's currently no way to declare which trait combinations a test target actually needs to run against. Here's the bug, the pitch, and the naming collision that'll trip you up first.

6 min read
A labeled drawer organizer with everything in its own compartment
SwiftUI Swift Macros

Custom @Environment Values Used to Need Five Lines of Boilerplate. Now They Need One.

The @Entry macro replaces the EnvironmentKey struct, defaultValue, and extension boilerplate every custom SwiftUI environment value needed — but it changes a couple of defaults you should know about before you migrate.

5 min read
An aerial view of a highway bypass lane cutting past a long line of traffic — the shortcut this pitch takes around Swift's type checker
Swift SwiftPM

The Fix for SwiftPM's 200-Second Compile Bug Just Landed. It Skips the Type Checker Entirely.

A new Swift Forums pitch replaces embedInCode's byte-array literals with linked object files and Span<UInt8>, turning a 70-second, 7.2GB build into a 1.6-second one. Here's how it works and why one reviewer already isn't sure it's worth the complexity.

7 min read
Stacked shipping containers, neatly indexed and labeled — the kind of file system SwiftPM's embedded resources still don't have
Swift SwiftPM

SwiftPM Embeds Resources as Byte Arrays. One 165KB File Can Take 200 Seconds to Compile.

A fresh Swift Forums pitch wants to give SwiftPM's .embedInCode a real, path-preserving EmbeddedFileSystem — fixing both its lack of directory structure and a documented type-checker bug where a single resource file bloats debug build times by minutes.

6 min read
Rows of server storage racks, the kind of content-addressed cache infrastructure SwiftPM is about to borrow from
Swift Swift Evolution

SwiftPM Is Getting Real Compilation Caching. My Five Cold Builds a Day Are About to Get Cheaper.

SE-0547 brings CAS-backed compilation caching to SwiftPM: content-addressed cache keys instead of timestamps, with reported 67-75% faster clean builds. Here's what it actually configures, and why it matters more for worktrees and CI than for your everyday edit-build-run loop.

7 min read
An old padlock and key resting against weathered metal — the kind of lock you can see is doing something, unlike a token sitting quietly in RAM
Swift Keychain

The Actor That Refreshes Your Token Perfectly. It Also Forgets It on Relaunch.

AuthTokenStore solved the token-refresh race condition with a Swift actor. What it never solved is where the token lives between launches. Here's why an in-memory actor isn't secure storage, and what a Keychain-backed version actually costs you.

8 min read
Scattered puzzle pieces on a table, none of them quite matching — a stand-in for a view SwiftUI keeps mistaking for a different one
SwiftUI Swift

SwiftUI Reset My State for No Reason. The Bug Was Identity, Not Bindings.

A text field kept clearing itself on every re-render, and no amount of staring at @State fixed it. The actual cause was SwiftUI's view identity system silently deciding my view was a brand new one. Here's how identity actually works and the three ways to break it.

8 min read
Person holding a phone with eyes closed, representing non-visual interaction
SwiftUI Accessibility

VoiceOver in SwiftUI: The Five Bugs Your Beautiful UI Is Hiding

SwiftUI gives you accessibility almost for free, until the moment it doesn't. A practical checklist of the five VoiceOver bugs that show up in real apps, and the SwiftUI modifiers that actually fix them.

7 min read
An old telephone switchboard with patch cables connecting calls to different lines
Swift Swift Concurrency

Your @MainActor Code Was Never Promised the Main Thread. Swift's About to Make That Official.

Swift Evolution's fourth pitch for Custom Main and Global Executors quietly confirms something most iOS developers get wrong: @MainActor guarantees serialized isolation, not literally Thread.main. Here's what changes and why it matters.

7 min read
Close-up of a microcontroller circuit board with visible chips and traces
Swift Embedded Swift

Embedded Swift Won't Let You Cheat. Turns Out That's a Feature.

Embedded Swift bans existentials, reflection, and the Objective-C runtime to fit Swift on microcontrollers. The restrictions it enforces are the same discipline that makes regular iOS code faster — and BrewLog's own networking layer breaks the rule on line one.

7 min read
A dimly lit warehouse aisle at night, empty and waiting
Background Tasks BGTaskScheduler

Your Background Task Isn't Broken. iOS Just Decided It Wasn't Worth Running.

BGTaskScheduler doesn't promise your task will run — it's a request, scored against battery, usage patterns, and network state. Here's how the budget actually works, how to test it without waiting three days, and how to design a sync that survives never being called.

7 min read
Macro photo of a computer chip circuit board
Foundation Models On Device AI

Why Your On-Device Foundation Models App Feels Dumber Than the Demo

A deep-dive into LLM inference on Level1Techs explains why the same model gives different answers on different hardware — and it maps disturbingly well onto Apple's on-device Foundation Models.

7 min read
A neatly organized drawer with everything in its own compartment
Swift Swift Evolution

Swift Finally Lets You Put a Memberwise Init Where It Belongs

SE-0546 fixes a Swift limitation nearly a decade old: you couldn't define a struct's memberwise initializer in a same-file extension. Here's why that mattered, with a real example from a Live Activity.

6 min read
A single closed padlock hanging on a chain, evoking something used exactly once and then done
Swift Swift Concurrency

Swift Wants to Let a Closure Promise 'I Run Once.' Here's the Bug That's Been Waiting For It.

A fresh Swift Evolution pitch, @called(once), lets the compiler know a function is invoked at most one time — and that one guarantee quietly unlocks Task closures that consume non-Sendable values and non-Copyable captures that don't work today. Here's the errors it fixes, in real code.

7 min read
A studio microphone against a dark background, standing in for on-device speech transcription.
Swift Speech Framework

Apple's On-Device Speech API Reserves Five Locale Slots. You Never Get Them Back.

A developer who actually shipped an app on SpeechTranscriber and Foundation Models found that AssetInventory.release(reservedLocale:) doesn't release anything. I checked Apple's own docs against the bug report, and the gap between what's documented and what happens on a real device is the whole story.

8 min read
Rows of small identical storage compartments, evenly spaced
Swift Evolution Swift

InlineArray Just Got Hashable. Here's Why That Took a Whole Proposal.

SE-0543 was accepted on August 18, 2026, giving InlineArray a Hashable conformance. It sounds like a one-line addition — it wasn't. Here's what InlineArray actually is, why Hashable needed its own proposal, and where a fixed-size, stack-allocated array earns its keep over a regular Array.

6 min read
An open padlock hanging on a chain-link fence
AI Coding Tools GitHub Actions

An AI 'Security Fix' Introduced the Bug. GitHub's Own AI Review Called It Clean.

GitHub Copilot Autofix rewrote a Snowflake CI workflow and quietly introduced a shell injection vulnerability. GitHub's AI code review approved the PR anyway. Five days later, a different AI found it and walked straight into Snowflake's internal Jira. Here's what it means for your own GitHub Actions pipeline.

7 min read
A tangled knot of cables, impossible to trace one strand from end to end
Swift SwiftUI

Weak Self Isn't the Retain Cycle Fix You Think It Is in @Observable

The old [weak self] advice was written for closures capturing classes. @Observable changes what actually gets captured, and in a few common SwiftUI patterns weak self silently does nothing at all. Here's where it still matters and where it's dead weight.

7 min read
An open drawer of a vintage card catalog cabinet, packed with densely filed index cards
SQLite SwiftData

A 16-Year-Old SQLite Bug Just Surfaced. Your SwiftData App Is Sitting on the Same Engine.

Tailscale spent six months and 19 database corruptions tracking down the SQLite WAL-Reset bug, unfixed since 2010 and patched in 3.51.3. SwiftData and Core Data both run on SQLite in WAL mode — so I checked which version iOS 26.2 actually ships, and what it means for your app.

9 min read
Two dirt roads splitting apart between trees, one path diverging from the other
Open Source AI Coding Tools

Oracle Banned AI-Generated Code From OpenJDK. Its Own GraalVM Team Didn't Get the Memo.

OpenJDK's April 2026 policy bans any AI-generated content from Java's core repos, while Oracle's own GraalVM project explicitly allows it. I went looking for what happens if you try the same thing with the Swift compiler — and found a gap worth knowing about before you PR AI-written Swift anywhere.

8 min read
A large iceberg floating in the ocean, most of its mass hidden underwater
AI Coding Vibe Coding

Hacker News Is Fighting Over Whether Code Was Ever the Hard Part. Two of My Own Bugs Settle It.

A viral Hacker News thread (658+ points) argues that 'code was never the hard part' is an insult to programmers. I went looking through my own BrewLog bugs from the last two weeks for evidence — and found one on each side.

7 min read
A building permanently wrapped in construction scaffolding
SwiftUI iOS Development

SwiftUI Just Turned Seven. Hacker News Is Having the Itch.

SwiftUI shipped in 2019 and just hit its seven-year mark, and a viral Hacker News thread (plus pieces from Yakov Manshin and John Gruber) is relitigating whether it ever grew up. I've built a real app in it for months — here's where my own bugs match the complaints, and where they don't.

7 min read
An organized box of wrenches and hand tools, each one distinct but sharing the same case — a Swift toolbox metaphor
Foundation Models Swift

Apple Just Open-Sourced the 'Skills API' Everyone Assumed Was a Claude Thing

Apple's new foundation-models-utilities package brings a Skills API, history compaction, and a chat-completions bridge to Swift's Foundation Models framework. Here's what's actually in the box, and how it maps onto BrewLog.

7 min read
A black digital clock display against a dark background, evoking a countdown running out
Swift Swift Concurrency

Swift Just Got a Real Timeout API. Here's What We've All Been Duct-Taping Instead.

SE-0526 withDeadline was accepted into Swift on July 30, 2026 — a real, composable, absolute-time-limit API for async operations. I found the exact gap it fills in a real app's networking layer, fixed it today's way with a TaskGroup race, and lined it up against what withDeadline will let me delete once it ships.

10 min read
A compact multi-port GAN charging adapter — one small brick, several different outputs, which is exactly the pitch behind a library that puts several AI backends behind one Swift interface.
Swift SwiftUI

I Tried the Library That Puts Foundation Models, OpenAI, and MLX Behind One Swift API

SwiftAI is a new open-source Swift package that wraps Apple's on-device Foundation Models, OpenAI, and MLX behind one interface — reply(to:), @Generable structs, streaming, tool calls. I actually installed it, ran real on-device inference, and hit a documentation bug and a guardrail glitch within ten minutes. Here's what works, what doesn't, and whether it's worth adopting today.

8 min read
A welcome doormat by a front door — the world's most obvious hiding spot, and a fair metaphor for the API key baked straight into an app's network traffic.
iOS Development Security

Two-Thirds of AI iPhone Apps Hid the Key Under the Doormat

A Wake Forest study ran 444 AI-powered iOS apps through traffic analysis and found 282 of them leaking their own LLM API keys — OpenAI, Anthropic, cloud creds, the works. Stolen keys fuel 'LLMjacking' that can burn $46,000 a day on someone else's bill. Here's why it keeps happening and how to ship AI features with zero secrets in your bundle.

8 min read
A close-up black and white photograph of a mechanical stopwatch — the kind a track coach would hold, not a Rolex — face-on, hands frozen mid-second.
Xcode iOS Development

Build Time Optimization for the Solo iOS Developer Running 5+ Apps

Day 30 of the 30-day iOS series. Real numbers, real DerivedData chaos, and the three things that actually move the needle on Xcode build times when you're maintaining multiple apps on one machine.

9 min read
A wooden rubber stamp reading 'geprüft' (checked) resting on an open legal document, mid-stamp — something getting verified before it's allowed to count as approved.
Swift Swift Macros

Custom Swift Macros: When They're Actually Worth the Build-Time Cost

Day 29 of the 30-day iOS series. The difference between @freestanding and @attached macros, why most macro ideas are over-engineering traps, and a real #URL macro — built TDD-first as a standalone Swift package — that catches BrewLog's force-unwrapped base URL at compile time instead of runtime.

9 min read
A vintage black typewriter and a modern MacBook sitting side by side on a wooden desk, shot from directly above — the old tool and the new one, both still doing real work.
Swift UIKit

UIKit Tricks SwiftUI Still Can't Do (Yet): Back to UIViewRepresentable

Day 28 of the 30-day iOS series. SwiftUI has no PDF viewer, no custom keyboard primitive, and no waterfall grid — five real gaps where you still reach for UIViewRepresentable, anchored by a real PDFKit-backed brew history export built TDD-first for BrewLog.

10 min read
An espresso machine portafilter pouring two separate streams of coffee into two paper cups sitting side by side on a stainless steel drip tray — one source, two independent streams.
Swift Combine

Combine in 2026: The Three Cases Where It's Still Better Than async/await

Day 27 of the 30-day iOS series. A real searchable brew history for BrewLog, built with Combine instead of async/await, and the three reasons it was the right call: debounce, independent multiple subscribers, and a four-way CombineLatest pipeline.

10 min read
A hand squeezing the last drips of coffee from a paper filter into a Chemex — the kind of multi-minute brew that's worth glancing at from the Lock Screen instead of standing over.
Swift ActivityKit

Live Activities and the Dynamic Island: A Decision Matrix, Not a Demo

Day 26 of the 30-day iOS series. A real ActivityKit countdown for BrewLog's pour-over timer, the one-function decision matrix that decides which brew methods even get one, and the exact reason it still won't show up on a Lock Screen.

10 min read
Close-up of an espresso machine's row of glowing buttons — press one, skip the rest of the ceremony, which is the entire pitch of an App Intent.
Swift WidgetKit

WidgetKit and App Intents: Logging a Brew Without Opening the App

Day 25 of the 30-day iOS series. A real App Intent that logs a brew from Spotlight or a widget button, the @Dependency crash that nearly cost me an evening, and the honest line between what's tested and what's still a mechanical Xcode step.

9 min read
A red and black Swiss Army knife fully opened, blade, bottle opener, and corkscrew all fanned out at once — one handle doing five jobs, which is exactly the problem this post is about.
Swift SOLID Principles

SOLID Principles in Swift: One Bad Class, Five Real Fixes

Day 24 of the 30-day iOS series. Skip the acronym slide — here's the 70-line class I'd have shipped on day one of BrewLog, broken against all five SOLID principles, and the five already-tested files in this same repo that actually fix it.

11 min read
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
A red traffic light glowing above an unlit green light on a city street — the stop-then-go cycle that gives test-driven development its name.
Swift TDD

TDD for SwiftUI: A Red-Green-Refactor Workflow That Isn't Academic

Day 21 of the 30-day iOS series. I went looking for a BrewLog feature to drive test-first and found a real bug already shipped: the Streak stat has been hardcoded to zero since day one. Here's the actual red-green-refactor session that fixed it.

10 min read
Developer writing code with testing tools visible — a clean coding environment representing software quality and unit testing.
Swift Swift Testing

Swift Testing Framework: Why You Should Migrate from XCTest

Day 20 of the 30-day iOS series. @Test, #expect, parametrized tests, traits, and a side-by-side comparison on a real BrewLog test file. Plus: the one thing XCTest still does that Swift Testing doesn't.

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
A security guard in a dark uniform standing alert on a grey floor, arms at their sides.
StoreKit 2 App Store Server API

StoreKit 2, Part 3: Server-Side Receipt Validation in 2026 (App Store Server API)

Day 17 of the 30-day iOS series, the finale of three on monetization. You can't trust the client — here's the minimal App Store Server API workflow for BrewLog: Server Notifications V2, JWSTransaction decoding, a Cloudflare Worker, and three pure Swift tests that prove the entitlement logic without ever calling Apple.

13 min read
A coir doormat reading 'well, hello there.' on a red brick step in front of a blue door with red trim.
StoreKit 2 Swift

StoreKit 2, Part 2: Free Trials, Win-Back Offers, and Promo Codes That Actually Convert

Day 16 of the 30-day iOS series. I add a 7-day free trial, a win-back banner for lapsed subscribers, and offer-code redemption to BrewLog's paywall — concrete App Store Connect configuration plus the Swift code, all covered by Swift Testing.

17 min read
A heavy brass padlock fastened through the latch of a teal metal door.
StoreKit 2 Swift

A StoreKit 2 Paywall From Scratch: Subscriptions, a Transaction Listener, and a Restore Button That Works

Day 15 of the 30-day iOS series, first of a three-part run on monetization. I built BrewLog's real paywall with StoreKit 2 — two subscription products, a transaction listener, and a restore flow — with zero third-party SDKs. Every number the paywall shows comes from one pure, tested function.

13 min read
A stack of labeled cardboard moving boxes and houseplants against a wall, mid-move.
SwiftData Core Data

SwiftData Two Years Later: What's Solid, What Still Bites, and the Migration Test You're Not Writing

Day 14 of the 30-day iOS series. SwiftData is about two years old now, and the honest verdict is mixed. I already wrote the long field report on where it broke in production — this post is the part that report didn't have room for: a VersionedSchema + SchemaMigrationPlan test that proves a schema change is safe BEFORE TestFlight finds out for you.

12 min read
A laptop screen showing a dark-mode analytics dashboard with line and bar charts tracking load time, bounce rate, and session metrics.
Swift SwiftUI

@Observable vs ObservableObject: What 1,000 Rows and a Redraw Counter Actually Showed Me

Day 13 of the 30-day iOS series. I built a redraw counter into BrewLog, put 1,000 rows in two identical lists side by side — one backed by @Observable, one by ObservableObject — and toggled a single favorite ten times. The row counts tied 10-10. The list counts didn't. Here's the real number, and exactly where it comes from.

13 min read
A flat lay of overlapping vintage paper maps at different scales — local town plans layered under a wider regional survey of the Isle of Wight.
Swift SwiftUI

@State, @Bindable, @Environment: The Complete Map for @Observable (and the Question You're Actually Asking)

Day 12 of the 30-day iOS series. With @Observable, SwiftUI lets you slap @State, @Bindable, @Environment, or a plain let on the same class — and compiles all of them. Here's the question that actually decides which one is correct, one map that resolves 95% of the confusion, and three real BrewLog bugs (one silent, one a compile error, one a runtime crash) that come from picking wrong.

11 min read
A person leaning into a coin-operated lookout telescope, observing a savanna in the distance — you keep feeding the machine to keep watching.
Swift SwiftUI

ObservableObject → @Observable: The Migration Guide That Skips the Marketing (and the Autoclosure Gotcha Apple Forgot to Mention)

Day 11 of the 30-day iOS series. Apple's migration guide makes ObservableObject → @Observable look like a find-and-replace. It mostly is — except for one quiet behavioral change: @StateObject only ran your initializer once, and @State runs it on every render. Here's the multiple-init bug that causes, why it's worst in exactly the init you were proud of, and how to fix it with a test that turns 'no side effects in init' into a hard, green invariant.

12 min read
A bright orange DETOUR road sign with a black arrow pointing right — the moment a request reroutes from the on-device model to the server.
Swift SwiftUI

ThinkBud + Foundation Models: What I Shipped On-Device, and the Wall That Sent Me Back to the Server

Day 10 of the 30-day iOS series, the build-in-public finale of AI week. I took the on-device Foundation Models stack from Days 8 and 9 and bolted it into ThinkBud, an app I actually ship. Here's the honest field report: the bounded tasks the on-device model nailed for free and offline, the context-window wall a 100K-character textbook import smashed into, and the exact line of code where I gave up and routed to a server. Plus the one decision that's pure Swift — so it gets a real test.

13 min read
A speaker presenting on a conference stage to a packed audience — the energy of a keynote that changes what you'll build next (Photo: Unsplash)
WWDC 2026 iOS 27

Tim Cook Wiped a Tear, Siri Got a Google Brain, and Apple Shipped a Transparency Slider. WWDC 2026, Honestly.

The WWDC 2026 keynote just happened. Tim Cook's emotional farewell, Siri rebuilt on Gemini, Core AI replacing Core ML, Xcode 27 going full MCP, and Liquid Glass finally getting a slider. Here's what actually matters for your iOS codebase — no press release fluff.

8 min read
A grid of metal letterpress type blocks set into wooden compartments — each slot a defined, typed character, the analog ancestor of structured output.
Swift SwiftUI

@Generable: Make Apple's On-Device Model Hand You a Swift Struct, Not a String to Parse

Day 9 of the 30-day iOS series, part 2 of AI week. Yesterday Foundation Models gave us a String. Today we make it give us a typed Swift value — BrewSummary(flavor:, advice:, rating:) instead of a paragraph you regex your way through. @Generable, @Guide constraints, session.respond(to:generating:), and the sleeper-within-the-sleeper: tool calling, where the on-device model calls your own Swift code mid-answer. With the TDD seam, because typed output changes what you test.

14 min read
An open notebook with the word 'Notes' handwritten and underlined, a fountain pen resting on the page, reading glasses blurred behind it — the raw input a summarizer turns into one clean line.
Swift SwiftUI

Foundation Models: Your First On-Device AI Feature With No Backend, No API Key, No Bill

Day 8 of the 30-day iOS series, and the start of AI week. The Foundation Models framework runs a real language model entirely on the phone — free, private, offline. We build the smallest thing that works: summarize a block of text in three lines, handle the availability cases that bite in production, wire it into a real app, and put a TDD seam around the part that isn't the model. Code-along, with tests.

12 min read
A building wrapped in scaffolding mid-renovation — the new facade isn't up yet, so the old one stays protected. The same call you make with UIDesignRequiresCompatibility while your redesign is still in flight.
Swift SwiftUI

UIDesignRequiresCompatibility: When (and Why) Opting Out of Liquid Glass Is the Pro Move

Apple hands you one Info.plist key that freezes the old design for a full year. It's not a cop-out — for banking, enterprise, and apps caught mid-redesign, opting out of Liquid Glass is the responsible call. The exact flag, a real before/after from my own app, the deadline, and a decision matrix you can actually defend in a standup. Plus the per-screen rollout gate you should be testing instead.

11 min read
Light refracting through layered glass into a spray of color — the same object reading differently under different light, the way one Icon Composer document renders as light, dark, clear, and tinted.
Swift SwiftUI

Icon Composer and the New App-Icon Era: One Document Instead of Three Exported PNGs

iOS 26 wants your app icon in light, dark, clear, and tinted. The old way was three flat 1024px PNGs that quietly drifted apart. Icon Composer turns it into one layered .icon document the system relights for you. The real workflow from a single SVG to a full set — plus the one decision around icons you can actually unit-test.

12 min read
Orange and teal ink diffusing through water, translucent layers blending and morphing into each other — the visual metaphor for layering and morphing Liquid Glass effects.
Swift SwiftUI

Custom Liquid Glass Components: When to Leave the Defaults (and the Three Mistakes That Kill Your Frame Rate)

glassEffect(.regular, in:) with a custom shape, two glass blobs that morph into each other with glassEffectID, and the three things that turn buttery Liquid Glass into a stutter machine. Built on a real iPhone 17 Pro simulator, with the TDD seam that keeps the decision testable even though the render isn't.

12 min read
A dramatic red theater curtain on an empty stage — symbolizing Tim Cook's final WWDC keynote curtain call before handing the CEO role to John Ternus
WWDC 2026 Tim Cook

Tim Cook's Curtain Call: His Last WWDC Keynote and What Changes for Every iOS Developer

Tim Cook delivers his final WWDC keynote on June 8 before handing the CEO role to hardware chief John Ternus on September 1. After 15 years, a $350B-to-$4T run, and a developer ecosystem of 2.3 billion devices, here's what the transition actually means for people who write Swift for a living.

10 min read
Close-up of textured, refractive glass with warm amber-to-cream tones — the real-world material Apple's Liquid Glass design language imitates on screen.
Swift SwiftUI

Liquid Glass for an App You Already Shipped: What You Get From a Recompile vs. Five Lines of Tuning

I rebuilt a real SwiftUI app against the iOS 26 SDK and took two screenshots of the exact same screen — one with zero code changes, one with five lines of glassEffect. Here's the honest split between what the recompile hands you for free and what's worth your custom-tuning time, plus the TDD seam that makes a visual feature testable.

10 min read
A laptop glowing in the dark, casting blue and orange light — reflecting Apple's 'All Systems Glow' WWDC 2026 tagline and the divided developer sentiment
WWDC 2026 iOS 27

Apple Said 'All Systems Glow.' Developers Said 'Not So Fast.'

Apple dropped its WWDC 2026 tagline yesterday and the developer forums immediately caught fire. Half the community is excited for iOS 27's AI overhaul. The other half is already mourning the operating system they used to love. With six days until the keynote, here's what the divide tells us about where Apple is headed.

9 min read
Before/after comparison of an Invoize view model migration to Swift 6.2 — 86 errors on the left collapsing into 3 nonisolated annotations and a fixed race condition on the right.
Swift Swift 6.2

Migrating a Real App to Swift 6.2 Strict Concurrency: 86 Errors, One Afternoon, One Race Condition I Didn't Know I Had

I migrated Invoize from Swift 6.0 strict mode to Swift 6.2 approachable concurrency on a Sunday afternoon. Every warning, every fix, the one real race condition the compiler finally surfaced — and the TDD seams I leaned on so the migration wasn't just compiler-driven guessing.

14 min read
A massive tree with branches spreading in every direction — a visual metaphor for choosing between Swift 6.2 isolation modifiers.
Swift Swift 6.2

@concurrent vs nonisolated vs @MainActor: The Swift 6.2 Decision Tree That Fits on a Napkin

Four real scenarios — UI update, network call, image decode, file IO — and exactly which Swift 6.2 isolation keyword each one needs. A TDD walk-through with Swift Testing, no whiteboard ceremony required.

13 min read
iPhone capturing an AI visualization on a laptop screen — representing Apple's native MCP support turning every iOS app into a tool for AI agents
iOS Development MCP

Apple Is Turning Every App Into an AI Tool — MCP Support Means Siri Was Just the Warm-Up

Apple is building native Model Context Protocol support on top of App Intents. That means Claude, ChatGPT, Gemini, and every other AI agent will be able to control your app — not just Siri. Nine days before WWDC 2026, here's what this means for iOS developers and why your App Intents just became the most important code you've ever written.

10 min read
A glowing 'One Way' street sign at night — a visual metaphor for Swift 6.2 making the main actor the default direction
Swift Swift 6.2

MainActor by Default: Why Apple Just Reversed Swift's Concurrency Story

Xcode 26 flips the default — your code now runs on the main actor unless you say otherwise. Here's why Apple changed direction, what it actually means for your existing project, and a TDD walk-through showing the migration in real Swift.

11 min read
A hand holding a keyring near an open door — representing Apple opening its walled garden to Google's AI models for on-device intelligence
WWDC 2026 iOS 27

Google's AI Is About to Run on Every iPhone. Apple Thinks That's a Feature, Not a Bug.

Apple is training distilled versions of Google's Gemini to run directly on iPhones. For iOS developers, this means your Foundation Models code might soon be powered by Google under the hood — and WWDC 2026 will make it official. Here's what changed, why it matters, and what to build before June 8.

8 min read
Lines of code on a dark screen — the kind of code that's about to get a major AI upgrade when Apple drops its new developer platform at WWDC 2026
WWDC 2026 iOS 27

Apple Registered genai.apple.com. Twelve Days Before WWDC, the Biggest Clue Just Dropped.

Apple quietly registered a GenAI subdomain last week. It's not live yet, but the timing — twelve days before WWDC 2026 — tells us everything about where the iOS developer platform is headed. Core AI, Siri Extensions, Foundation Models, and a public-facing AI hub. Here's what it means for your next project.

9 min read
Heavy traffic congestion on a multi-lane highway at dusk — representing the App Store review queue gridlock caused by vibe coding's 84 percent submission surge in 2026
App Store iOS Development

Your Bug Fix Is Behind 235,800 Vibe-Coded Apps. Welcome to App Review in 2026.

App Store review times ballooned from under 24 hours to multi-week waits after vibe coding drove an 84% surge in submissions. Indie developers with critical bug fixes are stuck behind a flood of AI-generated apps. Here's the data, the developer stories, and what you can actually do about it.

7 min read
Lines of code with colorful syntax highlighting on a dark screen — representing Swift development breaking free from Xcode into AI-powered IDEs like Cursor and Kiro
Swift Cursor IDE

I Wrote Swift in Cursor for a Week. Xcode, We Need to Talk.

Swift officially hit the Open VSX Registry — meaning Cursor, Kiro, and every AI IDE now support Swift with full LSP, debugging, and test explorer. I spent a week building iOS code outside Xcode. Here's what worked, what didn't, and why Apple publishing a Cursor setup guide is the most understated power move of 2026.

8 min read
The glowing Apple logo on an Apple Store glass facade at night — representing Apple's expanding platform for third-party AI integrations through Siri Extensions
Siri iOS 27

Apple Is Building an AI App Store Inside Siri. Most Developers Haven't Noticed Yet.

iOS 27 will turn Siri into a chatbot with third-party Extensions — a dedicated App Store section for AI integrations. This is the biggest new distribution channel since widgets. Here's what indie iOS developers should be building right now.

9 min read
Tangled power lines and wires against a clear sky — a visual metaphor for Swift's growing language complexity and tangled feature set
Swift iOS Development

Swift Has 217 Keywords Now. Nobody Agrees on What It's For.

Swift started as a simple, elegant language that composed beautifully. Twelve years later, it has 217 keywords, a governance problem, and an identity crisis. With WWDC 2026 weeks away, the community is asking: is Apple killing its own programming language?

8 min read
Glowing digital network on dark background — matching the luminous aesthetic of Apple's WWDC 2026 Coming Bright Up invite
WWDC 2026 iOS 27

Apple's WWDC 2026 Invite Says 'Coming Bright Up' — We Decoded Every Pixel

The WWDC 2026 media invites dropped yesterday with a glowing Swift logo and the tagline 'Coming Bright Up.' Here's what Apple is really telling us about Siri 2.0, the Gemini partnership, and what iOS developers should prepare for in the next 20 days.

7 min read
Network cables plugged into a server rack — representing how MCP connects AI tools to developer infrastructure like a universal protocol
MCP Model Context Protocol

Your Xcode Has a Built-In MCP Server. Most iOS Developers Haven't Noticed Yet.

MCP is the protocol that lets AI tools talk to everything — your code, your simulator, your build system. Xcode 26.3 shipped one quietly. There's an official Swift SDK. And WWDC 2026 might make it the backbone of CoreAI. Here's what iOS developers need to know before everyone else figures it out.

9 min read
A close-up of a professional camera lens with warm light reflections — representing the new AI-powered Visual Intelligence pipeline Apple is bringing to iOS developers
WWDC 2026 iOS 27

Visual Intelligence Is the Sleeper Hit of WWDC 2026. Most Developers Don't See It Coming.

Apple is opening Visual Intelligence to third-party developers at WWDC 2026 — nutrition scanning, contact capture, Wallet passes, and a full camera AI pipeline. While everyone argues about Siri, this is the API that will actually change how your app works. Here's what we know and how to prepare.

7 min read
A monitor displaying lines of code in a dark IDE — representing the developer experience of working with Xcode's updated AI coding agent
Xcode AI

Xcode 26.5 Just Made Its AI Agent Less Annoying. Is That Enough?

Xcode 26.5 shipped two small features — message queuing and clarifying questions — that fix the most frustrating parts of agentic coding. Here's what actually changed, why it matters more than it sounds, and whether Apple's AI coding agent is finally ready for your daily workflow.

9 min read
A 'For Rent' sign on a building facade — representing the platform landlord dynamic between Apple's Siri and iOS developers being asked to move in
iOS 27 Siri

Apple Wants You to Move Into Siri's New House. Read the Lease First.

iOS 27 turns Siri into a full chat app with conversation history, document uploads, and deep app integration. Apple is courting developers to build for it — but won't promise it won't charge commission later. Here's why some developers are hesitating, and what you should actually do.

8 min read
Colorful sticky notes pinned to a planning board — the analog version of what your Xcode project needs right now
WWDC 2026 iOS 27

WWDC 2026 Is 26 Days Away. This Is Your iOS Developer Pre-Flight Checklist.

WWDC 2026 lands June 8. SiriKit deprecation, Core AI replacing Core ML, Liquid Glass refinements, foldable iPhone APIs, and strict concurrency in Swift 7. Here's the practical pre-flight checklist to run through your codebase right now — before the keynote makes it urgent.

8 min read
iPhone home screen showing Siri Suggestions with app icons — representing how AI-powered discovery is becoming the primary way users find and launch apps
iOS Development App Intents

App Intents Are the New SEO — and Most iOS Developers Are Still Invisible

Siri is becoming the front door to every iPhone. App Intents are no longer a nice-to-have — they're the difference between discoverable and dead. Here's a practical guide to making your app visible before WWDC 2026 changes the rules.

9 min read
Two developers sitting across from each other in an interview setting — the ritual that no longer matches how iOS apps are actually built in 2026
iOS Development Career

iOS Interviews Are Broken in 2026 — And Everyone Knows It

Companies test you on raw Swift memorization while their production code is 40% AI-generated. The iOS interview process in 2026 is a theater performance nobody believes in anymore. Here's what's actually wrong and what should replace it.

8 min read
Two phones side by side in different operating systems — visual stand-in for Swift code now compiling natively for both iOS and Android.
Swift Swift 6.3

Swift 6.3 on Android, Three Weeks In: What Actually Broke and What Surprised Me

When Apple shipped Swift 6.3 with first-class Android support last month, I bet a Saturday on porting a piece of ThinkBud's sync engine to Android. Three weeks of usage later — here's what stuck, what didn't, and the one bug that taught me more than a year of Swift Concurrency reading.

9 min read
Colorful thread spools organized neatly on shelves — a visual metaphor for Swift's newly organized approach to concurrency
Swift Swift 6.2

Swift 6.2 Finally Made Concurrency Approachable — Someone Already Built a Parody Site

Swift 6.2 ships @MainActor by default, the new @concurrent attribute, and a complete rethink of strict concurrency. We break down what changed, show real migration code, and explain why the community is both celebrating and arguing.

9 min read
Two monitors displaying code side by side — representing the Claude Code vs Cursor developer tool comparison
Claude Code Cursor

Claude Code vs Cursor: I Used Both for a Month. One Tried to Charge $1,400.

Cursor is the sous chef who hands you the knife before you ask. Claude Code is the contractor who remodels your kitchen overnight. We tested both on real iOS projects and here's when each one wins — plus how to avoid that terrifying billing surprise.

10 min read
The Swift programming language logo displayed on an Android smartphone — representing Apple's official Swift SDK for Android
Swift Android

Swift 6.3 Now Officially Runs on Android. I Tried It. Here's What Actually Works.

Apple shipped an official Swift SDK for Android with Swift 6.3. Not a hack, not a community port — the real thing. We tested it on a real project and here's every win, every friction point, and the honest verdict on whether iOS developers should care.

9 min read
Monitor displaying code in a dark development environment — representing the late-night Xcode 26 migration sessions developers are pulling before Apple's SDK deadline
iOS Development Xcode 26

Apple's iOS 26 SDK Deadline Hits Tomorrow. Half the App Store Isn't Ready.

April 28, 2026 — every app submitted to the App Store must be built with Xcode 26 and the iOS 26 SDK. If you haven't updated yet, your next submission gets rejected. Here's what's breaking, what you need to fix, and why this deadline is different.

10 min read
Close-up of colorful programming code on a dark screen representing intensive AI-powered code refactoring session
AI Claude

We Gave Claude Mythos Full Access to Our Codebase. It Shipped Three Features Before Lunch.

After a week of security testing, we let Anthropic's most restricted AI model loose on real development work. It refactored our state management, found a memory leak we'd chased for months, and rewrote our networking layer across four apps. Week two was a different beast.

8 min read
Apple WWDC 2026 official event branding — the developer conference bringing foldable iPhone APIs, Core AI framework, and major platform changes
WWDC 2026 iOS 27

Apple Is Shipping Foldable iPhone APIs Before the Foldable iPhone. That's Either Genius or Chaos.

WWDC 2026 drops June 8. Apple is giving developers fold-state detection, Core AI replacing Core ML, macOS touch APIs, and a Siri that lives in the Dynamic Island. Here's what you need to know and what we're already building.

9 min read
Close-up of an Apple silicon chip highlighting the Neural Engine that powers on-device AI in iPhones and iPads
Foundation Models Apple Intelligence

Apple Put a 3-Billion Parameter Brain Inside Every iPhone. Most Developers Haven't Even Noticed.

Apple's Foundation Models framework lets you run AI on-device with 3 lines of Swift. No API keys. No cloud bills. No privacy headaches. Here's why iOS developers should stop ignoring the smartest thing Apple shipped in years.

11 min read
Apple WWDC 2026 event branding — the annual developer conference where Apple is expected to open Siri to third-party AI chatbots
WWDC 2026 iOS 27

Apple Stopped Pretending It Could Build AI Alone. That's the Best WWDC News in Years.

WWDC 2026 is two months away. Apple is opening Siri to Claude, Gemini, and Grok. Xcode already has agentic coding. iOS 27 is a stability year. Here's what iOS developers actually need to care about.

8 min read