r/SwiftUI • u/Warm_Membership_1180 • 16h ago
Tutorial Rendering Mac App Store screenshots from my SwiftUI views: 4 gotchas
Added a debug flag that renders the store screenshots from the real views with sample data. What tripped me up:
- Render inside a real offscreen NSWindow, or scroll views and text editors don't draw right.
- Disable animations. There's no display link offscreen, so transitions never finish.
- Blur vanishes offscreen. I swapped it for radial gradients.
- cacheDisplay can't draw the sidebar material. I used CGWindowListCreateImage for that window.
That last one is deprecated though. Anyone found another way to capture vibrancy from your own window?