如何防止ios11中的屏幕记录

由于某些原因,我们的APP不希望人们记录屏幕,但在ios11中一个新function可以让用户在那里录制iphone屏幕,所以是否有API或通知指示我用户正在录制现在非常感谢你

您可以检测屏幕是否正在录制:

UIScreen.main.isCaptured // True if this screen is being captured (eg recorded, AirPlayed, mirrored, etc.) 

您无法使用项目设置阻止它,但您可以使用模式或其他东西来请求用户禁用它。 不确定如何使用您的AppStore提交进行锻炼。

您可以在iOS 11中使用kvo观察UIScreenCapturedDidChangeNotification

 NSOperationQueue *mainQueue = [NSOperationQueue mainQueue]; [[NSNotificationCenter defaultCenter] addObserverForName:UIScreenCapturedDidChangeNotification object:nil queue:mainQueue usingBlock:^(NSNotification * _Nonnull note) { //code you want execute }];