本文介绍了如何检测何时敲击RPSystemBroadcastPickerView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我正在使用RPSystemBroadcastPickerView从我的应用程序开始系统范围的屏幕录像. RPSystemBroadcastPickerView在开始录制和所有操作方面完全是自主的,我想这是有道理的-只有用户可以通过明确点击按钮来开始屏幕录制.

I am using RPSystemBroadcastPickerView to start a system-wide screen recording from my app. The RPSystemBroadcastPickerView is completely autonomous in starting the recording and everything, which I guess makes sense - only user can start the screen recording by explicitly tapping the button.

我需要知道何时点击RPSystemBroadcastPickerView.现在,UI正在显示键盘,我想一直显示它(这是一个聊天应用程序).但是,键盘下方显示的表格显示了要选择的广播扩展列表.见下图:

I need to know when the RPSystemBroadcastPickerView is tapped. Right now the UI is showing keyboard, which I want to keep showing (it is a chat app). However, the form showing the list of broadcast extensions to pick one is being shown under the keyboard. See following image:

这有效地防止了用户开始广播.如果我知道用户何时点击RPSystemBroadcastPickerView,则可以在那一刻手动隐藏键盘.有什么建议吗?

This effectively prevents the user to start the broadcast. If I knew when the user tapped RPSystemBroadcastPickerView, I could manually hide the keyboard at that moment. Any suggestions?

推荐答案

我没有为此找到任何回调,但是您可以创建透明按钮,并将其添加到 RPSystemBroadcastPickerView 上方.当用户点击您的按钮时,您将能够隐藏键盘,然后使用以下代码将操作转移到 RPSystemBroadcastPickerView :

I did not find any callbacks for that, but you can create your transparent button, add it above the RPSystemBroadcastPickerView. When user will tap on your button you will be able to hide the keyboard and than transfer the action to the RPSystemBroadcastPickerView using the code:

for subview in screenSharingProviderPickerView.subviews {
    if let button = subview as? UIButton {
         button.sendActions(for: UIControlEvents.allTouchEvents)
    }
}

这篇关于如何检测何时敲击RPSystemBroadcastPickerView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 07:11