Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable screen Recording in iOS app

Is there any way to disable the screen recording? or is is possible through a configuration profile? or any third party library is available?

like image 214
Alok Maurya Avatar asked Dec 21 '18 07:12

Alok Maurya


1 Answers

NotificationCenter.default.addObserver(self, selector: #selector(preventScreenRecording), name: NSNotification.Name.UIScreenCapturedDidChange, object: nil)

And create a view inside main view and prevent like that.

(void) preventScreenRecording {
if (@available(iOS 11.0, *)) {
    BOOL isCaptured = [[UIScreen mainScreen] isCaptured];

    if (isCaptured) {
        self.blockView.hidden = false;
    }
    else {
        self.blockView.hidden = true;
    }
}
like image 126
PPShein Avatar answered Oct 04 '22 20:10

PPShein