如何在iOS应用中禁用屏幕录制 [英] How to disable screen Recording in iOS app
本文介绍了如何在iOS应用中禁用屏幕录制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有什么方法可以禁用屏幕录制吗?还是可以通过配置文件进行配置?或任何第三方库可用?
Is there any way to disable the screen recording? or is is possible through a configuration profile? or any third party library is available?
推荐答案
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;
}
}
这篇关于如何在iOS应用中禁用屏幕录制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文