You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/platforms/apple/guides/ios/session-replay/customredact.mdx
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,3 +75,28 @@ To hide the username, we need to mask it.
75
75
.sentryReplayUnmask()
76
76
}
77
77
```
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
+
structContentView_Previews: PreviewProvider {
95
+
staticvar 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