/// 监听录屏截屏
public func monitorRecordVideoAndScreenshot() {
if #available(iOS 11.0, *) {
//录屏通知
NotificationCenter.default.addObserver(self, selector: #selector(showWarningView_recordVideo), name: UIScreen.capturedDidChangeNotification, object: nil)
}
//截屏通知
NotificationCenter.default.addObserver(self, selector: #selector(showWarningView_screenshot), name: UIApplication.userDidTakeScreenshotNotification, object: nil)
}
/// 监测当前设备是否处于录屏状态
public func vcIsCaptured(){
//监测当前设备是否处于录屏状态
if #available(iOS 11.0, *) {
let sc = UIScreen.main
if sc.isCaptured {
showWarningView_recordVideo()
}
}
}