For detecting iOS11 screen recording feature On or Off I used isCaptured and UIScreenCapturedDidChange Notification.
When first time I Launch the App and On iOS11 built-in screen recording feature then it notifies the selector method with value True, but when I kill (terminate) my running App and Launch app again do the same procedure again then my selector method is not getting called.
Here is my code:
I add an Observer in ViewWillAppear() method:
NotificationCenter.default.addObserver(self, selector: #selector(handleNotification), name: NSNotification.Name.UIScreenCapturedDidChange, object: nil)
The selector method is as follows:
@objc
func handleNotification(notification:Notification){
let isCaptured = UIScreen.main.isCaptured
print("isCaptured value = \(isCaptured)")
}
In this case, I need to kill the app, clear the cache and again launch the app for getting screen recording event.
Please suggest what I can do here to detect recording event to protect my content from recording.
mirrored
property onUIScreen
? – Pepin