Skip to content

Instantly share code, notes, and snippets.

@SunXiaoShan
Created December 14, 2018 07:58
Show Gist options
  • Save SunXiaoShan/eda962cf792d901558b8835befec0c29 to your computer and use it in GitHub Desktop.
Save SunXiaoShan/eda962cf792d901558b8835befec0c29 to your computer and use it in GitHub Desktop.
extension ViewController: RPBroadcastActivityViewControllerDelegate {
func broadcastActivityViewController(_ broadcastActivityViewController: RPBroadcastActivityViewController, didFinishWith broadcastController: RPBroadcastController?, error: Error?) {
// Step 1
guard error == nil else {
print("Broadcast Activity Controller is not available.")
return
}
// Step 2
broadcastActivityViewController.dismiss(animated: true) {
// Step 3
broadcastController?.startBroadcast { error in
// Step 4
if error == nil {
print("Broadcast started successfully!")
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment