From 54cf39986014ebbe05247257dd650a0886c1aa10 Mon Sep 17 00:00:00 2001 From: Dhiogo Brustolin Date: Thu, 23 Jan 2025 15:39:28 +0100 Subject: [PATCH 1/2] `sentryReplayUnmask` and `sentryReplayUnmask` preventing interaction. --- CHANGELOG.md | 1 + Samples/iOS-SwiftUI/iOS-SwiftUI/ContentView.swift | 2 +- Sources/SentrySwiftUI/SentryReplayView.swift | 10 ++++------ 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e5267e17c5..6c3429ef3bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Fixed - Use strlcpy to save session replay info path (#4740) +- `sentryReplayUnmask` and `sentryReplayUnmask` preventing interaction () ## 8.44.0-beta.1 diff --git a/Samples/iOS-SwiftUI/iOS-SwiftUI/ContentView.swift b/Samples/iOS-SwiftUI/iOS-SwiftUI/ContentView.swift index ea5d75249d9..77563b15f9d 100644 --- a/Samples/iOS-SwiftUI/iOS-SwiftUI/ContentView.swift +++ b/Samples/iOS-SwiftUI/iOS-SwiftUI/ContentView.swift @@ -195,7 +195,7 @@ struct ContentView: View { } Button(action: showTTD) { Text("Show TTD") - } + }.sentryReplayUnmask() } VStack(spacing: 16) { Button(action: { diff --git a/Sources/SentrySwiftUI/SentryReplayView.swift b/Sources/SentrySwiftUI/SentryReplayView.swift index 78fe5d8342f..ecf94f5d45f 100644 --- a/Sources/SentrySwiftUI/SentryReplayView.swift +++ b/Sources/SentrySwiftUI/SentryReplayView.swift @@ -19,13 +19,11 @@ struct SentryReplayView: UIViewRepresentable { class SentryRedactView: UIView { } - func makeUIView(context: Context) -> UIView { - let view = SentryRedactView() - view.isUserInteractionEnabled = false - return view + func makeUIView(context: Context) -> SentryRedactView { + return SentryRedactView() } - func updateUIView(_ uiView: UIView, context: Context) { + func updateUIView(_ uiView: SentryRedactView, context: Context) { switch maskBehavior { case .mask: SentryRedactViewHelper.maskSwiftUI(uiView) case .unmask: SentryRedactViewHelper.clipOutView(uiView) @@ -37,7 +35,7 @@ struct SentryReplayView: UIViewRepresentable { struct SentryReplayModifier: ViewModifier { let behavior: MaskBehavior func body(content: Content) -> some View { - content.overlay(SentryReplayView(maskBehavior: behavior)) + content.overlay(SentryReplayView(maskBehavior: behavior).disabled(true)) } } From 385f1ae46c0258a6dba817e3b9a949e6105dd05f Mon Sep 17 00:00:00 2001 From: Philip Niedertscheider Date: Thu, 23 Jan 2025 17:26:12 +0100 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c3429ef3bf..1cd8132b6b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ ### Fixed - Use strlcpy to save session replay info path (#4740) -- `sentryReplayUnmask` and `sentryReplayUnmask` preventing interaction () +- `sentryReplayUnmask` and `sentryReplayUnmask` preventing interaction (#4749) ## 8.44.0-beta.1