-
Notifications
You must be signed in to change notification settings - Fork 2
Known limitations & tradeoffs
Arnaud Joubay edited this page Jul 20, 2023
·
2 revisions
For technical reasons, and because the project is still in its infancy, there are certain limitations. I will try to find better ways to address them: do reach out to talk about it.
-
Maps won't be rendered.
-
Workaround. Rely on
@Environment(\.isAspirinShot)
to replace the Map with anImage
-
Workaround. Rely on
-
Videos won't be rendered.
-
Workaround. Rely on
@Environment(\.isAspirinShot)
to replace the Video with anImage
-
Workaround. Rely on
-
Keyboard cannot be featured in the screenshot since it would cover the whole screenshot
-
Workarounds.
- Opiniated: a keyboard takes up 50% of your application's design. This is a missed opportunity to highlight the value/design of your application. Rethink the screenshot, show 2 half screens instead of one, add other elements to support the message, etc.
-
Image: export keyboards from the Apple Design Resources and add them as an
Image
(use assets localization if necessary) -
Old style: for that particular view, generate screenshots using a more traditional way and insert them as
Image
by taking advantage of assets localization
-
Workarounds.
-
Controls (Menu, etc.)
-
Workarounds.
-
Image: use the resources Apple Design Resources to export the missing component and add it as an
Image
-
Old style: for that particular view, generate screenshots using a more traditional way and insert them as
Image
by taking advantage of assets localization
-
Image: use the resources Apple Design Resources to export the missing component and add it as an
-
Workarounds.
-
Sheets won't work as they would cover the whole screenshot
-
Workarounds
- Use the
.screenshotAsSheet()
modifier and call.productBezel(statusBar: .white)
or.screenshotStatusBar(.white)
to have a status bar - Fullscreen: Present the view directly (as if it were a full screen overlay)
- ZStack: Create a ZStack manually with the calling view in the background
- Use the
-
Workarounds
-
NavigationSplitView on macOS: you can't just drop that as the root of your screenshot, it won't be rendered.
- Workaround: You'll need to use an HStack with your views. See the Starter Kit for an example.
-
Controls & Title on macOS: they won't appear in the screenshot, just like they don't appear in previews
- Workaround: Recreate it. See the Starter Kit for an example.
- If your app uses AttributedStrings or NSLocalizedStrings, the localization won't work out of the box because of the simulator. But, the package comes with drop-in replacements (
AttributedStrings(envLocalized:)
and*NSLocalizedStrings(envLocalized:)
). See their doc for more details.