I am using RPSystemBroadcastPickerView to start a system-wide screen recording from my app. The RPSystemBroadcastPickerView is completely autonomou
I found similar solution to accepted answer, but you don't need to create transparent button.
I just add additional target-action pair to the picker button dispatch table, with #selector which will be fired, when button is pressed.
/// picker is an instance of RPSystemBroadcastPickerView
for subviews in picker.subviews {
if let button = subviews as? UIButton {
button.addTarget(self, action: #selector(pickerAction), for: .touchUpInside)
}
}
/// You can also accept _ sender: UIButton as parameter, if you need to.
@objc func pickerAction() {
/// called when user press on RPSystemBroadcastPickerView
}
Note: Keep in mind that, if Apple change hierarchy of this view in the future, you probably need to update application as well.