title: How to hide Views from screenshots/screen recordings in SwiftUI
body: <p>SwiftUI has a <code>SecureField</code> text field which doesn't show anything typed into it when viewed from screen recordings or screenshots. Similarly, iOS 15 is going to have a <code>.privacySensitive()</code> modifier that removes the View from widgets and such. Does anyone have any idea on how to implement Views like this? I want a View which blurs itself when it's contained in screen recordings, screenshots, app widgets, multitasking menu (so they can't cheat the system) etc.</p>
  <p>Any suggestions on how to achieve this effect would be greatly appreciated.</p>
  <p>Thanks in advance!</p>
  <p><strong>Edit:</strong> You can tell if someone has opened the multitasking menu by subscribing to <code>NotifcationCenter.default.publisher(for: UIApplication.willResignActive, perform: { _ in })</code>. However I still haven't been able to figure out the others</p>
  <p><strong>Edit 2:</strong> I also found that subscribing to <code>UIScreen.capturedDidChangeNotification</code> tells you if screen recording is active. Still stuck on screenshots and widgets</p>