Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,12 @@ Snapshot previews should be deterministic. Avoid live network calls, timers, ani

## Detecting the snapshot environment

Set `XCODE_RUNNING_FOR_PREVIEWS=1` in your unit test scheme to mirror the variable Xcode sets when rendering live previews. You can then disable preview-unfriendly behavior (logging, analytics, network calls) with a single check:
Set `SNAPSHOTS_RUNNING_FOR_PREVIEWS=1` in your unit test scheme to mirror the variable Xcode sets when rendering live previews. You can then disable preview-unfriendly behavior (logging, analytics, network calls) with a single check:

```swift
extension ProcessInfo {
var isRunningPreviews: Bool {
environment["XCODE_RUNNING_FOR_PREVIEWS"] == "1"
environment["SNAPSHOTS_RUNNING_FOR_PREVIEWS"] == "1"
}
}
```
Expand Down
Loading