Incredible debugging experience — iOS 18 widget appearance mystery solved
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:
- Read all widget Swift source files and verified the code was correct (
@Environment(\.colorScheme)usage,containerBackground, theme helpers) - Researched online — found Apple Developer Forums threads about dead code stripping, TestFlight caching, and widget rendering bugs
- Inspected the IPA binary — used
stringsandnmto verify the widget extension was compiled and included correctly - Investigated the build pipeline — discovered that
eas build --localruns incremental prebuild (not--clean), which can skip Xcode project changes - Added
DEAD_CODE_STRIPPING = NOto the widget extension build settings (a known TestFlight fix) - Analyzed git history to pinpoint exactly which commits introduced the light mode support
- 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
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗