---
title: "makeViewController(element:existingViewController:)"
framework: tvmlkit
role: symbol
role_heading: Instance Method
path: "tvmlkit/tvinterfacecreating/makeviewcontroller(element:existingviewcontroller:)"
---

# makeViewController(element:existingViewController:)

Returns a view controller for a view element.

## Declaration

```swift
optional func makeViewController(element: TVViewElement, existingViewController: UIViewController?) -> UIViewController?
```

## Parameters

- `element`: The view element requesting a view controller.
- `existingViewController`: The current view controller.

## Return Value

Return Value The new view controller associated with the view element. If the app doesn’t handle this event, you must return nil.

## Discussion

Discussion When possible, update the view controller contained in the existingViewController parameter instead of creating a new view controller.

## See Also

### Updating View Information

- [makeView(element:existingView:)](tvmlkit/tvinterfacecreating/makeview(element:existingview:).md)
- [collectionViewCellClass(for:)](tvmlkit/tvinterfacecreating/collectionviewcellclass(for:).md)
- [playerViewController(for:)](tvmlkit/tvinterfacecreating/playerviewcontroller(for:).md)
