posthog-ios icon indicating copy to clipboard operation
posthog-ios copied to clipboard

chore: manually mask swiftui views

Open marandaneto opened this issue 1 year ago • 2 comments

:bulb: Motivation and Context

Alternative solution for https://github.com/PostHog/posthog-ios/issues/162 You inject a synthetic view into the marked view and get the X and Y positions based on that component. You don't have access to the original view but you know where it should be masked.

:green_heart: How did you test it?

:pencil: Checklist

  • [x] I reviewed the submitted code.
  • [ ] I added tests to verify the changes.
  • [x] I updated the docs if needed.
  • [x] No breaking change or entry added to the changelog.

marandaneto avatar Sep 23 '24 15:09 marandaneto

@ioannisj you can pick this up if you wish, the PoC works, just need to polish and finish it

marandaneto avatar Oct 07 '24 13:10 marandaneto

  • Updated relevant documentation under this PR
  • Replaced PostHogScreenshotMasker with an associated UIView property phIsManuallyMasked which is then grabbed during findMaskableWidgets call

ioannisj avatar Oct 10 '24 09:10 ioannisj

@ioannisj I cannot approve my own PR so feel free to get it approved/merged after fixing the conflicts.

marandaneto avatar Oct 14 '24 08:10 marandaneto