---
title: "setViewController(_:for:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uisplitviewcontroller/setviewcontroller(_:for:)"
---

# setViewController(_:for:)

Presents the provided view controller in the specified column of the split view interface.

## Declaration

```swift
func setViewController(_ vc: UIViewController?, for column: UISplitViewController.Column)
```

## Parameters

- `vc`: The child view controller to associate with the provided column of the split view interface.
- `column`: The corresponding column of the split view interface. See doc://com.apple.uikit/documentation/UIKit/UISplitViewController/Column for values.

## Discussion

Discussion This method doesn’t apply to classic split view controllers with a style of UISplitViewController.Style.unspecified. For a classic split view controller, instead use the viewControllers property to assign the primary and secondary view controllers that you want to display initially. After the split view controller is onscreen, set the child view controllers using the show(_:sender:) and showDetailViewController(_:sender:) methods. For a column-style split view controller, you use this method to assign child view controllers to a specific column of the split view interface. In general, unless your view controller is a navigation controller, the split view creates its own navigation controller to wrap the view controller you assign to the primary, supplementary, and secondary columns. There are some exceptions to this behavior: For the primary column, if you assign a UIViewController (or custom subclass) whose first child view controller is a UINavigationController, the split view controller uses that navigation controller as the primary view controller for collapsing the interface and for placing the button to change the display mode. For the secondary column, if you assign a UIViewController (or custom subclass) whose first child view controller is a UINavigationController, the split view controller uses that navigation controller as the secondary view controller for placing the button to change the display mode.  |   |   |   |   |  You can’t assign a UITabBarController to the primary or supplementary columns.

## See Also

### Managing the child view controllers

- [UISplitViewController.Column](uikit/uisplitviewcontroller/column.md)
- [viewController(for:)](uikit/uisplitviewcontroller/viewcontroller(for:).md)
- [viewControllers](uikit/uisplitviewcontroller/viewcontrollers.md)
