My App is very sensitive and it is a must to prevent a screen recording
it was working fine using UIScreen.main.isCaptured
and UIScreen.capturedDidChangeNotification
But for iOS 18 it became deprecated an not working any more and the replacement as apple says is sceneCaptureState I tried that in a demo app and I found that it is working only for a scene-based app but it’s not working for the old structure so now i have that problem,
my app is very big and does not support scenes at all what shall I do to prevent screen recording ?
note the following code is what I am using and not working for non-scene-based app is
window.traitCollection.sceneCaptureState == .active
this line gives me wrong value if you killed the app and re-opened it again
registerForTraitChanges([UITraitSceneCaptureState.self])
this for observing the changes only and works fine
initiated recording screen the open the app for the first time then
window.traitCollection.sceneCaptureState == .active
this line gives me false value while it should give me true
Note: My app does not support any scene configuration
Shrief_Nasr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.