---
title: "previewControllerDidFinish(_:)"
framework: replaykit
role: symbol
role_heading: Instance Method
path: "replaykit/rppreviewviewcontrollerdelegate/previewcontrollerdidfinish(_:)"
---

# previewControllerDidFinish(_:)

Indicates that the preview view controller is ready to be dismissed.

## Declaration

```swift
optional func previewControllerDidFinish(_ previewController: RPPreviewViewController)
```

## Parameters

- `previewController`: The preview view controller to be dismissed.

## Discussion

Discussion When the user is finished making changes to a screen recording, your app is responsible for dismissing the view controller representing the user interface. Call dismiss(animated:completion:) after getting the message to dismiss the preview view controller.

## See Also

### Dismissing the View Controller

- [previewController(_:didFinishWithActivityTypes:)](replaykit/rppreviewviewcontrollerdelegate/previewcontroller(_:didfinishwithactivitytypes:).md)
