RPSystemBroadcastPickerView
A view displaying a broadcast button that, when tapped, shows a broadcast picker.
Declaration
class RPSystemBroadcastPickerViewOverview
Add this view to your view hierarchy to let users broadcast directly from your app. When a user taps the broadcast button, it displays a broadcast picker, allowing the user to select a broadcast provider.
You can limit the picker to a particular broadcast provider by setting preferredExtension to the bundle identifier of a broadcast extension. You can also show or hide the microphone button displayed in the picker by setting the showsMicrophoneButton property. Set these properties before presenting RPSystemBroadcastPickerView, as shown here:
class ViewController: UIViewController {
@IBOutlet var containerView: UIView!
override func viewDidLoad() {
super.viewDidLoad()
let broadcastPicker = RPSystemBroadcastPickerView(frame: CGRect(x: 0, y: 0, width: 50, height: 50))
broadcastPicker.preferredExtension = "com.your-app.broadcast.extension"
containerView.addSubview(broadcastPicker)
}
}