---
title: UIContextMenuContentPreviewProvider
framework: uikit
role: symbol
role_heading: Type Alias
path: uikit/uicontextmenucontentpreviewprovider
---

# UIContextMenuContentPreviewProvider

Returns the custom view controller to use when previewing your content.

## Declaration

```swift
typealias UIContextMenuContentPreviewProvider = () -> UIViewController?
```

## Return Value

Return Value The view controller to display in place of the system’s standard view controller. If you want UIKit to present your content using a default view controller, return nil.

## Discussion

Discussion Use this handler to load or create your custom view controller, configure it with your content, and return it to UIKit.

## See Also

### Creating the menu configuration object

- [init(identifier:previewProvider:actionProvider:)](uikit/uicontextmenuconfiguration/init(identifier:previewprovider:actionprovider:).md)
- [UIContextMenuActionProvider](uikit/uicontextmenuactionprovider.md)
