Young’s Blog

A blog to prevent memory distortion

Two SwiftData @Query Pitfalls — enum #Predicate and modelContext on Empty Lists

The Setup I was building Inbox/Archive list views for a document scanning app. Simple enough: filter documents by status using SwiftData’s @Query. Two compile-time surprises were waiting. Pitfall 1: #Predicate Can’t Compare Enums What I Wrote The natural approach: @Model class Document { var status: DocumentStatus // enum stored property // ... } enum DocumentStatus: String, Codable { case inbox, archived } Then in the view: @Query( filter: #Predicate<Document> { $0.status == .inbox }, sort: \Document.createdAt, order: .reverse ) private var documents: [Document] Looks clean. Doesn’t compile. ...

April 26, 2026 · 3 min · Young

Why Naming Your SwiftData Model 'Tag' Breaks Your Build (+ Xcode 16 .gitkeep Trap)

What I Was Trying to Do I started a new document scanning app and was setting up SwiftData models using TDD. Simple Document and Tag models: @Model class Tag { var name: String var color: String @Relationship(inverse: \Document.tags) var documents: [Document] } Built fine. No issues so far. Trap #1: That’s Not Your Tag The moment I used FetchDescriptor in a test file, it blew up: let fetched = try context.fetch(FetchDescriptor<Tag>()) error: 'Tag' is ambiguous for type lookup in this context Turns out SwiftUI already has a Tag type — the one used for identifying selection items in TabView and Picker. When your test file imports both @testable import scansort and SwiftUI (via SwiftData), the compiler can’t decide which Tag you mean. ...

April 26, 2026 · 3 min · Young

CodeFlash - Developer Code Pattern Spaced Repetition CLI Startup Idea

Problem Developers lack efficient spaced repetition methods when learning new frameworks or languages: Read about React hooks, Go concurrency, Rust ownership once and forget quickly Spend time daily re-looking up official docs for the same APIs Anki-style SRS requires manually creating cards — high entry barrier Stack Overflow bookmarks never get revisited “What was that API again?” — daily micro-inefficiency that compounds Pain Intensity: 7/10 - Subtle but compounds daily into significant learning inefficiency ...

April 23, 2026 · 4 min · Young

SelfHealTest Lite - Playwright Self-Healing Plugin Startup Idea

Problem UI automation tests break whenever the frontend changes due to selector mismatches: Design refactors change data-testid, CSS classes, and XPath selectors en masse CI pipelines fail frequently due to selector drift Developers spend hours weekly manually finding and fixing broken selectors Playwright users aren’t exempt — when locators break, manual updates are required Pain Intensity: 9/10 - Test maintenance is more painful than test authoring Market Primary Market: Global QA engineers, full-stack developers Segment: 1-50 person dev teams running E2E tests with Playwright TAM: Test automation market ~$25B (2025), CAGR 15-17% Key Fact: Existing self-healing tools (Healenium, Katalon, Testim) all target enterprise. No indie developer self-healing tool exists under $50/mo Solution SelfHealTest Lite - A self-healing npm plugin built specifically for the Playwright ecosystem ...

April 23, 2026 · 3 min · Young

ServerShell - Self-Hosting One-Click Deploy CLI Startup Idea

Problem Developers and power users interested in self-hosting face multiple barriers when deploying services: Each service (Nextcloud, Gitea, Vaultwarden) requires writing its own docker-compose.yml Reverse proxy (Nginx/Traefik/Caddy) setup + SSL certificate provisioning are separate tasks DNS record configuration, firewall rules, and volume management done manually PaaS tools like Coolify or CapRover are GUI-heavy and consume significant server resources End result: “I installed Docker, but now what?” → abandonment Pain Intensity: 9/10 - The core barrier to self-hosting adoption ...

April 23, 2026 · 4 min · Young

SpecLint Mono - Docker Compose Inline Linter Startup Idea

Problem Docker Compose files are YAML-based, so typos and structural errors go undetected in the IDE: Port conflicts (two services binding the same host port) only discovered at deploy time Volume path errors, nonexistent image tag references No warnings for deprecated options (version field, links, etc.) Cannot detect circular dependencies in depends_on graphs Environment variable reference errors (${VAR} undefined) only surface at runtime Pain Intensity: 8/10 - Daily config debugging for every developer using Docker Compose ...

April 23, 2026 · 3 min · Young

4 Apps, 4 Rejections — What I Learned from App Store Review

I launched 4 iOS apps in quick succession and got rejected on every single one. Here’s what happened and how to avoid the same traps. 1. IAP Products Registered But Not in the Binary App: Renio (subscription tracker) Guideline: 2.1(b) - App Completeness I created subscription products (Monthly, Yearly) in App Store Connect but submitted the app without implementing StoreKit. The products existed in the console but not in the code. ...

April 21, 2026 · 4 min · Young

Debugging SwiftUI Image Flickering: Three Bugs Stacked on Top of Each Other

The Problem I was building a music streaming app, and the album artwork kept flickering. Not just during track changes — even while playing the same song, the artwork would briefly disappear and reappear. The blurred background on the full player was especially bad. I figured it was slow image loading, so I added caching. Still flickered. Dug deeper and found three bugs stacked on top of each other. ...

April 21, 2026 · 3 min · Young

Handling Audio Interruptions in an iOS Music App with AVPlayer

The Problem I was building a Subsonic-based music streaming app. Background playback worked fine — until I noticed something odd: Play a song, send the app to the background Open YouTube and play a video (music stops — expected) Close the YouTube video Come back to the app: the pause button is showing, but no audio is playing The UI says “playing” while the actual audio is paused. Tapping the button toggles it to play, then you have to tap again. Broken UX. ...

April 21, 2026 · 2 min · Young

Why Storing Closures in SwiftUI @Observable Causes EXC_BAD_ACCESS

What I Was Trying to Do I was building an iOS music streaming app with detail views behind NavigationDestination. Each detail view had its own ViewModel, with API calls injected as closures. Something like this: @Observable final class PlaylistDetailVM { var songs: [Song] = [] var isLoading = false // API methods injected as closures private let fetchSongs: (String) async throws -> [Song] private let addToPlaylist: (String, [String]) async throws -> Void init( fetchSongs: @escaping (String) async throws -> [Song], addToPlaylist: @escaping (String, [String]) async throws -> Void ) { self.fetchSongs = fetchSongs self.addToPlaylist = addToPlaylist } } Created as @State inside NavigationDestination: ...

April 21, 2026 · 3 min · Young