快速拍摄屏幕录像或照片时,某些项目被遮挡 [英] Some items are blocked when taking a screen recording or picture for swift

查看:115
本文介绍了快速拍摄屏幕录像或照片时,某些项目被遮挡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做的是,当用户收到屏幕记录或照片时,我想隐藏任何ui元素,我向screenShield套件站点发送了一封电子邮件,但没有得到任何反馈.我必须尝试另一种方法.请帮助

What I'm trying to do is I want to hide any ui element when the user receives a screen recording or photo, I sent an email to the screenShield kit site, but didn't get any feedback. I have to try another method. Please help

推荐答案

您可以通过使用来检测是否正在录制屏幕;

You can detect whether the screen is being recorded or not by using;

UIScreen.main.isCaptured

您还可以使用通知来跟踪任何更改;

You can also use notification to track any changes;

NotificationCenter.default.addObserver(self, selector: #selector(didChangeCaptured(_:)), name: UIScreen.capturedDidChangeNotification, object: nil)


@objc func didChangeCaptured(_ notification: Notification) {
  if UIScreen.main.isCaptured {
   // do something here
  } else { 
   // do something here 
  }
}

这篇关于快速拍摄屏幕录像或照片时,某些项目被遮挡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆