---
title: "broadcastActivityViewController(_:didFinishWith:error:)"
framework: replaykit
role: symbol
role_heading: Instance Method
path: "replaykit/rpbroadcastactivityviewcontrollerdelegate/broadcastactivityviewcontroller(_:didfinishwith:error:)"
---

# broadcastActivityViewController(_:didFinishWith:error:)

Indicates that the broadcast activity view controller is ready to be dismissed.

## Declaration

```swift
func broadcastActivityViewController(_ broadcastActivityViewController: RPBroadcastActivityViewController, didFinishWith broadcastController: RPBroadcastController?, error: (any Error)?)
```

## Parameters

- `broadcastActivityViewController`: The broadcast activity view controller to be dismissed.
- `broadcastController`: Optional. The doc://com.apple.replaykit/documentation/ReplayKit/RPBroadcastController instance used to start and stop broadcasts to a selected service. When the user cancels service setup, this parameter is nil.
- `error`: An doc://com.apple.replaykit/documentation/ReplayKit/RPRecordingErrorDomain error. When a connection to a broadcast service has been set up successfully and the app is ready to broadcast, this parameter is nil.

## Discussion

Discussion When this method is called after a broadcast has been set up successfully, retain a reference to the RPBroadcastController instance contained in the broadcastController parameter to start and stop broadcasting.
