---
title: "previewController(_:didFinishWithActivityTypes:)"
framework: replaykit
role: symbol
role_heading: Instance Method
path: "replaykit/rppreviewviewcontrollerdelegate/previewcontroller(_:didfinishwithactivitytypes:)"
---

# previewController(_:didFinishWithActivityTypes:)

Indicates that the preview view controller is ready to be dismissed with associated activity types.

## Declaration

```swift
optional func previewController(_ previewController: RPPreviewViewController, didFinishWithActivityTypes activityTypes: Set<String>)
```

## Parameters

- `previewController`: The preview view controller to be dismissed.
- `activityTypes`: A set of activity types as listed in doc://com.apple.documentation/documentation/UIKit/UIActivity.

## 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

- [previewControllerDidFinish(_:)](replaykit/rppreviewviewcontrollerdelegate/previewcontrollerdidfinish(_:).md)
