AI 资讯
Swift 6.4 Brings New Language Features and Swift Testing/XCTest Interop
Currently available as a beta in Xcode 27, Swift 6.4 introduces a range of enhancements: better C interoperability, simplified OS availability check, fine-grained warning control, async support in defer, efficient iteration for non-noncopyable types, up to 4x faster URL parsing, and improved interoperability between Swift Testing and XCTest. By Sergio De Simone
AI 资讯
How to add license keys to a SwiftUI macOS app (in under an hour)
You built a Mac app, you want to sell it outside the App Store, and now you need licensing: a key the customer enters, an activation that sticks, and feature gates that hold up offline. Here's how to do it in an afternoon without standing up a backend. Note: this is cross-posted from the Keylight blog . I build Keylight, so this uses it as the worked example — the shape of the solution applies whatever SDK you choose. The three things licensing actually has to do Strip away the marketing and every licensing system does exactly three jobs: Activate — turn a key the user pastes in into proof-of-purchase bound to this device. Verify — on every launch, confirm that proof is still valid, including offline . Gate — unlock features based on the tier/entitlements the license carries. If you build this by hand you're writing a server, a crypto layer, and a state machine. The point of an SDK is to skip all three. 1. Add the SDK Add the Swift package in Xcode (File ▸ Add Package Dependencies) pointing at the Keylight Swift SDK, then configure it once with your tenant key at app launch: import Keylight let keylight = Keylight ( tenant : "your_tenant_key" ) 2. Activate a key Give the user a text field and call activate . This is the one online step — it exchanges the key for a signed, device-bound lease that's stored locally: do { try await keylight . activate ( key : enteredKey ) // lease stored — the app is now licensed on this device } catch { // show the user why: invalid key, device limit reached, etc. } 3. Verify on launch (offline-safe) On every subsequent launch you don't hit the network. The SDK verifies the stored lease's Ed25519 signature locally and hands you a state: switch keylight . checkOnLaunch () { case . licensed ( let lease ): unlockApp ( entitlements : lease . entitlements ) case . trial ( let daysLeft ): runTrial ( daysLeft : daysLeft ) case . expired , . invalid : showActivationScreen () } No server call, so the app opens instantly and works on a plane. Th
AI 资讯
I compared the licensing tools for my indie Mac app — the honest breakdown
I needed to license a macOS app I sell outside the App Store. I went down the rabbit hole so you don't have to. Here's the honest breakdown — what each tool is genuinely good at, and where it stops. No tool is "best"; they're good at different things. The two questions that decide everything Before the tools, answer these: Do you need real offline verification? (Desktop apps usually do — see firewalls, planes, air-gapped machines.) This eliminates the "license key is just a string you check over HTTP" options for serious use. Do you want payments handled too, or do you already have Stripe? Some of these are licensing-only; some are merchant-of-record that also do keys. The licensing-first tools Keygen — the one most people name first. Language-agnostic API, deep policy engine, open-source, self-hostable. Genuinely powerful. The cost is that it's primitives : you bring your own payments, wire the webhooks, and write the client code. Pick it when you want maximum control and don't mind assembling the flow. Cryptolens — classic license-key system with offline verification via signed responses. Strong .NET heritage. Solid if you're on Windows/.NET and want the traditional key + activation-count model. LicenseSpring — enterprise-leaning. Floating licenses, air-gapped activation, node-locking. Overkill for a solo indie app, right at home if you're selling into companies with offline/dark-site requirements. The payments-first tools (keys as a feature) Lemon Squeezy / Polar — merchant of record, so they handle sales tax for you, with a license-key API bolted on (activate / validate / deactivate). Great for getting paid fast across borders. The licensing side is basic — keys are essentially strings with an activation limit; offline verification isn't really their thing. Gumroad — the simplest possible "sell a thing, get a license key, verify over one endpoint." Fine for a cheap utility where piracy isn't worth fighting. Not infrastructure. StoreKit — only relevant if you shi
产品设计
Swift Structs — Building Your Own Custom Types 🏗️
So far we've been working with Swift's built-in types — String, Int, Bool, Array. But what if you...
产品设计
Pressure-Testing My Own Explanations — A Swift Writing Exercise
When you've worked with a concept long enough, there's a gap that can quietly open up between "I know...
AI 资讯
why a simple string match beat apple's nlembedding for local rag
Why a simple string match beat Apple's NLEmbedding for local RAG how apple's nlembedding drove me crazy and how i built my own hybrid search engine recently, while working on my personal ai agent (pheronagent), i was focused on perfecting its memory and retrieval system. everyone is talking about that famous acronym: rag (retrieval-augmented generation). the system is simple: i feed the agent my documents, it converts them into vectors (embeddings), and when i ask a question, it finds the most similar vectors and answers me. sounds perfect on paper, right? so, like any loyal apple ecosystem developer, instead of downloading massive models from external sources (or burning money on apis), i decided to use nlembedding—the native capability of the operating system that runs directly on-device. after all, apple had embedded this into the os; it was both fast and privacy-focused. but real life, as it turns out, doesn't progress as smoothly as wwdc presentations... where have i worked? - the first explosion it all started with a very innocent question. i had uploaded my cv to the system. while chatting with my agent, i casually asked: "where have i worked?" i expected the agent to fire up the metal cores in the background within seconds, find my cv, and list the companies for me. instead, the agent stared blankly. i opened the logs to see what the hell the search engine was doing behind the scenes. the shocking scenario was exactly this: cosine similarity between the query and my actual cv text: 0.587 the threshold i set for relevance: 0.60 it missed it by a hair! "no worries," i thought. "we can just lower the threshold a bit, make it 0.55, and call it a day." but then i saw the truly terrifying thing just one line below. for the exact same query, guess what score a completely irrelevant, junk record in the system—a list of files containing .ds_store—got? 0.59 - 0.60! wait a minute... my detailed, multi-page resume gets a score of 0.587 just because it doesn't contain th
开源项目
🔥 palmier-io / palmier-pro - macOS video editor built for AI
GitHub热门项目 | macOS video editor built for AI | Stars: 1,436 | 749 stars today | 语言: Swift
AI 资讯
WWDC 2026 - WidgetKit Foundations: A Practical Guide for Developers
What makes a widget worth building Apple frames good widgets around three qualities, and they're worth keeping in your head as design constraints, not just slogans: Glanceable — someone should understand it in a fraction of a second. Think Weather showing you just enough of today's forecast. Relevant — content should match the moment, the place, and the person's patterns. Calendar surfacing your next event is the canonical example. Personalizable — it should be configurable with the content that matters to that specific user. These three map directly onto the technical decisions you'll make: glanceable drives your view design, relevant drives your timeline strategy, and personalizable drives whether you reach for a configurable (App Intent) widget. The mental model: how a widget actually runs This is the part most newcomers get wrong, so it's worth being precise. Your widgets are delivered to the system from a widget extension , which is a separate process from your app. That separation has a real consequence: your app can't just hand data to the extension in memory. You share data through an app group container — a shared database, or UserDefaults backed by the group. Wire this up early; it's the thing people forget. Whether your app is UIKit or SwiftUI, the widgets themselves are always built in SwiftUI. The data flow is: WidgetKit asks your extension for content. That content is a timeline — a series of timeline entries . Each entry carries the data needed to render your view at a specific point in time. The rendered views are archived, and the system displays each one at its relevant time. The key insight hiding in step 4: your code is not running while the widget is on screen. The system renders archived views. This explains a lot of WidgetKit's API design, including why interactive elements use App Intents rather than closures. Building your first widget When you add a widget extension target, Xcode scaffolds most of what you need. The body returns a WidgetCon
AI 资讯
Swift VSX Support, Biome Type Inference, Agent Guardrails
This week's tooling news clusters around a recurring theme: removing dependencies that were never really necessary. Biome ditches the TypeScript compiler for type-aware linting. Swift developers stop caring which editor they're in. And the most interesting finding of the week is that a 1990s text-retrieval algorithm outperforms GPT-4 at catching lying agents. Here's what's worth your attention. Swift Extension Lands on Open VSX Registry The official Swift extension is now published to the Open VSX Registry, which means Cursor, VSCodium, AWS Kiro, and any other LSP-compatible editor that doesn't use the proprietary VS Code Marketplace can now auto-install it without you doing anything. Code completion, debugging, and the test explorer just work. This matters because the Swift toolchain has always been Xcode-or-fight. Any serious cross-platform Swift work meant manually tracking down extensions, pinning versions, and hoping nothing broke when someone cloned the repo on a different machine. Agentic IDEs that provision their own extensions automatically—like Cursor and Kiro—now get Swift support without intervention. Verdict: Ship. If you're already in an Open VSX-compatible editor, there's nothing to configure. Zero blocking concerns; this is a pure reduction in setup friction. Biome v2 Adds Type Inference Without TypeScript Biome v2 ships its own type inference engine, decoupling type-aware linting rules from the TypeScript compiler entirely. The headline number is 75% detection parity on floating promise rules compared to typescript-eslint—lower recall, but at meaningfully lower install weight and CI overhead. Multi-file analysis also lands in v2, unlocking rules that require cross-module context that were structurally impossible in v1. The real value proposition isn't feature parity—it's dependency elimination. Pulling TypeScript out of your lint pipeline reduces cold-start times in CI and removes a whole class of version-mismatch bugs between typescript , @typescri
AI 资讯
Weekly Dev Log 2026-W10
🗓️ This Week While organizing ideas for my first iOS app , I remembered an old web app idea called ToneDrill , which I had casually built before to help practice note names on a guitar fretboard🎸. I decided to try turning it into an iOS app 🛠️. I clarified the purpose of ToneDrill , its minimum requirements , and its core features , then organized them in Notion 📝. I was curious to see how well Codex could implement an iOS app from those minimum requirements , so I gave it a try right away💡. I reviewed the SwiftUI code generated by Codex and worked through the app logic to understand how it was implemented 🔍. For now, I was able to create a working app, which felt like a meaningful step forward 🚶. I created the top page UI design for my portfolio website in Figma 🎨. I focused on keeping the structure simple and implementation-friendly, and designed the UI with reusable components for each major part. Based on what I learned from my previous failed attempt, I tried again to see how well Codex could implement a prototype from the Figma UI design (You can read about my previous attempt that didn’t go so well here😅.) Worked on the AI Threat Modelling room from the AI Security Learning Path on TryHackMe this week🤖. 📱 iOS (SwiftUI) Revisited an old web app idea called ToneDrill, which I had previously built casually as a guitar note-training app, and considered turning it into an iOS app. Organized the app idea in Notion, including its purpose, target use case, minimum requirements, and core features. Decided to aim for an MVP-level version first, instead of trying to build a fully featured app from the beginning. Wrote down simple requirements and tested how accurately Codex could implement the initial version of the app. Reviewed the iOS app implementation generated by Codex and examined the code in detail to understand how the logic worked. 🌐 Web Development Posted my weekly dev log on Dev.to📝 Completed the top page UI design for my portfolio website in Figma. Tried us
AI 资讯
WWDC 2026 - Migrate to Swift Testing: What Actually Means for Your Test Suite
Swift Testing shipped with Xcode 16 back in 2024. Swift Testing was built from the ground up for Swift. That means Swift concurrency is a first-class citizen, test cases run in parallel by default, and the API surface is dramatically smaller than XCTest's forty-plus assertion functions. One macro, #expect , replaces most of them. If you are still on XCTest, you have probably felt the friction: class inheritance for every test suite, function names that must start with test , assertion messages that tell you what the values were but not where the expression came from. Swift Testing fixes all of this. That said, you do not need to migrate everything at once, and WWDC 2026 is emphatic about this. The Migration Strategy: Small Chunks, No Big Bang The session opens with something refreshing: permission to be slow about this. The recommended approach is to leave your existing XCTests where they are and start using Swift Testing only for new tests. Both frameworks can coexist in the same target and even the same file. You do not need a separate test target, and you do not need a migration sprint. The one rule: Swift Testing tests cannot live inside XCTestCase subclasses. Everything else is fair game. Raw Identifiers for Readable Test Names One small quality-of-life improvement worth knowing about from the start: Swift supports raw identifiers using backticks, and Swift Testing takes full advantage of this. import Testing @testable import DemoApp @Test func ` Default climate : tropical ` () async throws { let fruit = Fruit ( name : "Coconut" ) #expect(fruit.climate == .tropical) } No more testDefaultClimateTropical or dealing with camelCase names in test output. The test name is the test name. Interoperability: The Key to Reusing Your Helper Code This is the main new story in WWDC 2026 and the feature that makes incremental migration actually work. The problem: you have test helper functions that wrap XCTFail . You want to call them from new Swift Testing tests. Previously,
开源项目
🔥 apple / container - A tool for creating and running Linux containers using light
GitHub热门项目 | A tool for creating and running Linux containers using lightweight virtual machines on a Mac. It is written in Swift, and optimized for Apple silicon. | Stars: 30,953 | 2,419 stars today | 语言: Swift
AI 资讯
WWDC 2026 - What's New in SwiftUI - A Developer's Breakdown
WWDC26 brought a substantial round of updates to SwiftUI — not a ground-up redesign, but a lot of small limitations removed, new APIs that were clearly driven by real-world pain points, and meaningful performance improvements. This post walks through every major announcement so you know exactly what's available and when to reach for it. Look and Feel: Liquid Glass and the 2027 Releases The most immediately visible change costs you zero code. Apps built with SwiftUI automatically pick up the updated Liquid Glass appearance on the 2027 OS releases. The glass tint responds to the new system-level Liquid Glass slider without any changes on your part. On iPad, windows now dim when inactive, reinforcing which window has focus — again, automatic. On Mac, custom interactive Liquid Glass elements respond more fluidly to the mouse pointer. There are a few opt-in refinements available when you want tighter control: Responding to active state — use the appearsActive environment value to reduce opacity on custom elements when the window is inactive: struct SidebarFooterView : View { @Environment (\ . appearsActive ) private var appearsActive var body : some View { MyAccountView () . opacity ( appearsActive ? 1 : 0.5 ) } } Menu bar icons — the menu bar now shows a minimal set of icons by default. Add .labelStyle(.titleAndIcon) to a specific menu item to make its icon visible: CommandMenu ( "Stickers" ) { Button { openStore () } label : { Label ( "Store" , systemImage : "bag.fill" ) . labelStyle ( . titleAndIcon ) } } Resizability on iPhone iPhone apps become resizable on iOS 27, which matters for iPhone Mirroring and running iPhone apps on iPad. Xcode 27's Live Previews now include resize handles so you can test this interactively without running on a device. If your app mixes UIKit and SwiftUI, check the session "Modernize your UIKit app" for specifics around screen geometry, size classes, and orientation handling. Toolbar APIs The toolbar has been a source of friction on smalle
开发者
🌈 Pride Trivia & Alan Turing Edition — A SwiftUI Game for June Solstice Game Jam
Hey DEV community! 👋 I'm Gamya, an iOS developer and new here on DEV. So excited to be part of my...
AI 资讯
Zero Data Leakage: Running Llama-3 Locally on iPhone with MLX-Swift for Ultra-Private Health Logs
Your health data is probably the most sensitive information you own. Yet, most "AI Health Assistants" today require you to ship your symptoms, moods, and medical history to a cloud server. In the era of Edge AI and Privacy-preserving machine learning , this is no longer a trade-off we have to make. By leveraging the MLX Framework and Apple Silicon's unified memory, we can now run on-device LLMs like Llama-3-8B directly on an iPhone. This tutorial explores how to build a 100% offline, local health journal that summarizes your daily wellness without a single byte leaving your device. If you're looking for more production-ready patterns for secure AI, definitely check out the advanced guides over at Wellally Tech Blog . Why MLX-Swift? 🍏 Apple's MLX is a NumPy-like array framework designed specifically for Apple Silicon. When brought into the Swift ecosystem via mlx-swift , it allows us to tap into the GPU and Neural Engine with incredible efficiency. The Architecture: 100% Offline Inference Unlike traditional CoreML conversions that can be rigid, MLX allows for dynamic graph execution. Here is how the data flows from your typed notes to a structured health summary: graph TD A[User Input: Health Notes] --> B[SwiftUI View] B --> C{Privacy Layer} C -->|Local Only| D[MLX-Swift Engine] D --> E[Llama-3-8B Quantized Model] E --> F[Unified Memory / GPU] F --> G[Local Inference] G --> H[Markdown Health Summary] H --> B style C fill:#f9f,stroke:#333,stroke-width:4px style E fill:#00ff0022,stroke:#333 Prerequisites 🛠️ Device : iPhone 15 Pro or later (8GB RAM is highly recommended for Llama-3-8B). Software : Xcode 15.3+, iOS 17.4+. Tech Stack : MLX Framework, SwiftUI, Llama-3-8B (4-bit quantized). Step 1: Setting Up the MLX Engine First, we need to integrate the mlx-swift package. In your Package.swift , add: . package ( url : "https://github.com/ml-explore/mlx-swift-chat" , branch : "main" ) Now, let's initialize the model. Because we are on a mobile device, we must use a quantiz
AI 资讯
Migrating a Real App to Swift 6: Data Races, a Dependency I Had to Evict, and the Compiler That Wouldn't Let Me Lie
Let me start with a confession: I have been writing concurrent code since the only tool in the box was a mutex and a prayer. After a decade of Swift I feel suspicion of any code that touches two threads and claims to be fine. So when Swift 6 showed up promising to prove my concurrency correct at compile time, I had two reactions at once. The grizzled half of me said "sure, kid." The other half — the half that has spent actual weekends chasing a heisenbug that only reproduced on a customer's M1 under sync load — said "...please. Please be real." This is the story of moving Ditto Edge Studio — a SwiftUI debug-and-query tool for the Ditto edge database — to Swift 6's strict concurrency mode. It's a real app: SQLCipher persistence, an embedded MCP server, a SpriteKit presence graph, live sync over Bluetooth and WebSocket. Not a to-do list. The kind of app where concurrency bugs hide in the cracks and wait for a demo. Spoiler: it was worth it. It was also more work than the WWDC talk implied, and the most valuable thing the compiler did happened in the one place I told it to stop looking. Let me show you. First, the Wall: A Dependency That Wasn't Coming to Swift 6 Here's the thing nobody warns you about. Swift 6 language mode isn't really a per-file setting. Your code can be immaculate — every actor isolated, every Sendable accounted for — and you'll still be stuck, because one dependency that isn't Swift 6-ready can hold your entire module hostage. Mine was a code editor. I'd been using a popular SwiftUI editor package for the DQL query editor, and it transitively pulled in a syntax-highlighting library. Both were lovely. Both were also written for a more innocent time, and neither was going to compile under Swift 6 strict concurrency without upstream changes that weren't happening on my timeline. I had the usual three options, and I want to be honest about how tempting the cowardly ones were: Pin the dependency and leave the whole app at Swift 5. Free today, expensive
AI 资讯
I Built a Native macOS Tool to Improve Cloud Gaming Stability
Cloud gaming on macOS has improved a lot over the last few years, but I kept running into the same issues: random ping spikes, micro-stutters, Bluetooth latency, and network interruptions caused by background system services. Instead of tweaking settings manually every time I launched a gaming session, I decided to build a small native macOS utility to automate the process. The result is CloudBoost. The Problem When troubleshooting cloud gaming performance on macOS, I noticed that many issues weren't caused by internet speed. Even with a fast fiber connection, there were occasional interruptions caused by: Background wireless discovery services Network interface transitions Power management behaviors Input device acceleration Memory pressure during long gaming sessions These issues were small individually, but together they created a noticeably less consistent experience. The Approach Rather than creating another "system cleaner" application, I wanted something that would: Apply temporary optimizations only during gaming sessions Avoid permanent system modifications Use native macOS technologies Restore original settings when disabled The application focuses on automation instead of aggressive tuning. Building It CloudBoost was developed using: Swift SwiftUI Native macOS APIs UNIX system utilities already available on macOS The biggest challenge wasn't writing code. It was understanding which system behaviors actually affected cloud gaming and identifying changes that could safely improve consistency without creating side effects. Features Current functionality includes: Network optimization routines Temporary wireless service management Mouse acceleration controls Session-based optimization profiles Automatic restoration of original settings Native menu bar integration Automatic update checking through GitHub releases What I Learned One interesting lesson from this project is that performance optimization is often more about engineering decisions than programming c
AI 资讯
Building an unofficial Dumpert client for Apple TV with Swift 6 and SwiftUI
Dumpert is a Dutch video site I've watched for years, but there's never been an Apple TV app, so I built one. DumpertTV is an unofficial, open-source tvOS client. Here's how it's put together and a few things that were more interesting than I expected. Disclaimer up front: this project is not affiliated with Dumpert or DPG Media B.V. It's an independent app that uses the public Dumpert API. The stack Swift 6 with strict concurrency ( complete mode) across every target SwiftUI for all UI, tvOS 18+ XcodeGen so the .xcodeproj is generated from a project.yml and never committed CloudKit , GroupActivities (SharePlay), Vision , AVKit , Swift Testing One actor for the network, one source of truth for the UI The whole networking layer is an actor . That makes per-request state like ETags and retry bookkeeping thread-safe without a single lock: actor DumpertAPIClient { private var etags : [ URL : String ] = [:] func fetch < T : Decodable > ( _ endpoint : APIEndpoint ) async throws -> T { // Exponential backoff on 5xx + network errors; honours 304 Not Modified. try await fetchWithRetry ( endpoint , attempt : 0 ) } } The UI reads from a single @Observable @MainActor repository injected through the SwiftUI environment — no Combine, no view models competing over the same state: @Observable @MainActor final class VideoRepository { private(set) var hotshiz : [ MediaItem ] = [] let apiClient : APIClientProtocol // protocol-backed for testing } ContentView () . environment ( videoRepository ) Views just read repository.hotshiz ; updates flow automatically. With Swift 6's strict concurrency on, the compiler kept me honest about every actor hop. Things that were trickier than expected tvOS focus + a top tab bar. Getting a Netflix-style hero carousel to behave with the focus engine took real care. It also made automating screenshots interesting — scripted remote input doesn't reliably drive the simulator, so I added #if DEBUG launch-argument hooks to jump straight to any tab/category f
AI 资讯
[iOS] Why Passthrough MP4 Export Failed for iPhone Videos
A user picks a video from Photos. The app turns that video into a file the server can accept. Then it uploads the file. On the surface, this sounds like a simple upload flow. In practice, iOS makes you answer a much more specific question: How do you reliably turn a video from the user's Photo Library into an uploadable MP4 file? At first, I used AVAssetExportPresetPassthrough . It looked like the right default. It preserves the original media as much as possible, avoids unnecessary re-encoding, and is fast when it works. No quality loss, less CPU usage, less battery cost. But some videos failed during export. The error was usually in the AVFoundationErrorDomain Code=-11838 family. Apple describes this error as operationNotSupportedForAsset : an operation was attempted that is not supported for the asset. At first, I suspected an iCloud download issue, a Photos permission edge case, or something retryable inside PHImageManager . That was not the real problem. The actual problem was more fundamental: I was trying to write an iPhone MOV asset into an MP4 file using a passthrough export. The Original Flow The original code was roughly shaped like this: PHImageManager . default () . requestExportSession ( forVideo : asset , options : options , exportPreset : AVAssetExportPresetPassthrough ) { exportSession , info in exportSession ? . outputURL = outputURL exportSession ? . outputFileType = . mp4 exportSession ? . exportAsynchronously { // upload } } The intention was reasonable: Ask Photos for an export session for the PHAsset . Use AVAssetExportPresetPassthrough to preserve the original quality. Write the result as an .mp4 file for upload. Many videos exported successfully this way. That is what made the bug confusing. Some videos worked. Some did not. The hidden assumption was: Any iPhone video can become an MP4 file through a passthrough export. That assumption is not always true. iPhone Videos Are Usually MOV Files To a user, it is just "a video." Internally, an iPh
开发者
Key point in Do List 100 v2.0 Brings Due Dates, Auto-Progress and Full iPad & Mac Support
Hi everybody. We have created this app around two months and this is third version with fixed bugs. Now it is amazing app that synchronization your tasks throughs iPhone iPad Mac via iCloud with no Sign In! And in pocket you will already have a useful notes. It was a huge code work. Hours and hours. Such a pleasure. What I want to note here for you fellas, we were going from these scheme: What's really happening The self-overwrite loop User edits subtask title ↓ onChange fires → scheduleSave() → debounce 1s ↓ ...debounce fires → DataManager.save() writes todos.json to iCloud ↓ NSMetadataQuery detects file change on disk ↓ ↑ └── todosChanged() ───────┘ ↓ taskManager.loadTodos() ↓ self.todos = loadedTodos ← 💥 replaces entire array mid-edit The core problem is that NSMetadataQuery watches the file at the OS level. It has no concept of who made the change — your own app writing the file looks identical to another device syncing a change over iCloud. So every save you make triggers a reload that cancels whatever the user is currently doing. Why subtask titles are worst affected A TextField bound to $subtask.title is live — it reflects the array value character by character. The moment self.todos = loadedTodos runs, SwiftUI throws away the in-memory array and rebuilds from the freshly decoded JSON. If the save hasn't happened yet (debounce still counting down), the loaded file has the old title, and the field visually snaps back. Progress sliders have the same issue but it's less noticeable because a slider value is a Double — the snap-back is a jump rather than disappearing characters. Why it only shows up on real devices The simulator runs everything on the same Mac so iCloud writes are near-instant and the race window is tiny. On a real device the file system is slower and iCloud sync adds latency, making the timing gap between "user is editing" and "reload fires" much more visible. The three fixes needed Fix 1 — Ignore self-triggered reloads in DataManager Track a isS