Incredible debugging experience — iOS 18 widget appearance mystery solved

Resolved 💬 3 comments Opened Mar 17, 2026 by 2bTwist Closed Apr 15, 2026

What happened

I was debugging why my iOS WidgetKit widgets weren't adapting to light/dark mode. They worked perfectly on the simulator but refused to change appearance on my physical device.

Claude Code went through an incredibly thorough debugging process:

  1. Read all widget Swift source files and verified the code was correct (@Environment(\.colorScheme) usage, containerBackground, theme helpers)
  2. Researched online — found Apple Developer Forums threads about dead code stripping, TestFlight caching, and widget rendering bugs
  3. Inspected the IPA binary — used strings and nm to verify the widget extension was compiled and included correctly
  4. Investigated the build pipeline — discovered that eas build --local runs incremental prebuild (not --clean), which can skip Xcode project changes
  5. Added DEAD_CODE_STRIPPING = NO to the widget extension build settings (a known TestFlight fix)
  6. Analyzed git history to pinpoint exactly which commits introduced the light mode support
  7. After all technical fixes still didn't resolve the issue, Claude Code identified the actual root cause: iOS 18's home screen appearance override

In iOS 18, users can long-press the home screen → Customize → select "Dark" for the home screen. This forces ALL widgets to render in dark mode regardless of the system setting. @Environment(\.colorScheme) follows the home screen appearance, not the system setting. The simulator doesn't have this override, which is why it always worked there.

Why this was amazing

  • Claude Code didn't give up after the first fix didn't work
  • It systematically eliminated possibilities (code correctness → build pipeline → binary inspection → OS-level behavior)
  • When I pushed back and said "ULTRATHINK this", it launched parallel research agents to investigate git history, build pipeline, and Apple forums simultaneously
  • The final answer was a platform behavior that no amount of code inspection would have caught — it required knowledge of iOS 18's home screen customization features
  • The entire debugging session saved me hours of frustration

This is exactly the kind of deep, persistent problem-solving that makes Claude Code invaluable for mobile development.

Environment

  • Claude Code CLI
  • Expo / React Native with native Swift WidgetKit extensions
  • iOS 18 device, Xcode, EAS Build

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗