Skip to content

Commit 4f4429d

Browse files
committed
Reapply "Update customredact.mdx"
This reverts commit dd2692b.
1 parent dd2692b commit 4f4429d

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

docs/platforms/apple/guides/ios/session-replay/customredact.mdx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,28 @@ To hide the username, we need to mask it.
7575
.sentryReplayUnmask()
7676
}
7777
```
78+
79+
## Debugging session replay masking
80+
81+
To visualize which elements are being masked, you can enable a masking overlay.
82+
83+
Call the following method to display the red masking overlay on all masked views:
84+
85+
```swift
86+
SentrySDK.replay.showMaskingOverlay()
87+
```
88+
89+
You can preview masking during the design phase of your SwiftUI views using the `sentryReplayPreviewMask` modifier. This helps ensure proper masking without affecting the final release build.
90+
91+
To avoid accidentally including it in production, apply the modifier only in your preview code:
92+
93+
```swift
94+
struct ContentView_Previews: PreviewProvider {
95+
static var previews: some View {
96+
ContentView()
97+
.sentryReplayPreviewMask()
98+
}
99+
}
100+
```
101+
102+
This approach allows you to fine-tune masking behavior while designing your UI, ensuring sensitive information is properly protected in production.

0 commit comments

Comments
 (0)