Skip to content

[Feature Request] View masking preview for SwiftUI views #4633

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
amrfarid140 opened this issue Dec 13, 2024 · 3 comments · Fixed by #4737
Closed

[Feature Request] View masking preview for SwiftUI views #4633

amrfarid140 opened this issue Dec 13, 2024 · 3 comments · Fixed by #4737

Comments

@amrfarid140
Copy link

Problem Statement

I am integrating Session Replay in a SwiftUI based app with some custom masking rules. Each time I need to check how the view is masked, I have to run the app, wait for the session to appear on sentry, scroll the video to find my target screen and finally check the masking. Repeat until I've got it right.

This is very tedious to do and is error-prone.

Solution Brainstorm

Add a SwiftUI view modifier sentryMaskPreview that can be used to render a masked view in previews.

Are you willing to submit a PR?

Maybe

@github-project-automation github-project-automation bot moved this to Needs Discussion in Mobile SDKs Dec 13, 2024
@amrfarid140 amrfarid140 changed the title View masking preview for SwiftUI views [Feature Request] View masking preview for SwiftUI views Dec 13, 2024
@brustolin
Copy link
Contributor

Thanks for the suggestions, it's a good idea.

@philipphofmann
Copy link
Member

We can provide a way to somehow highlight the masked views with a background color, overlay color, or something so users can easily see which views get masked.

@philprime
Copy link
Contributor

I believe this is implemented as the view modifier sentryReplayPreviewMask() which works in Simulator, on device and Xcode Preview.

We are updating our documentation in getsentry/sentry-docs#12517.

I'll close this issue for now, if there are any concerns please feel free to reopen.

@github-project-automation github-project-automation bot moved this from In Progress to Done in Mobile SDKs Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants