<!--
{
  "availability" : [
    "iOS: 3.2.0 -",
    "iPadOS: 3.2.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UISplitViewController/viewControllers",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UISplitViewController(py)viewControllers"
  },
  "title" : "viewControllers"
}
-->

# viewControllers

The array of view controllers the split view controller manages.

```
var viewControllers: [UIViewController] { get set }
```

## Discussion

When the split view interface is expanded, this property contains two or three view controllers depending on the interface’s [`style`](/documentation/UIKit/UISplitViewController/style-swift.property). The first view controller in the array is the primary view controller. It’s followed by the supplementary (if present) and then the secondary view controller.

When the split view interface is collapsed, this property contains only one view controller. If a view controller is set for the [`UISplitViewController.Column.compact`](/documentation/UIKit/UISplitViewController/Column/compact) column, this property contains that view controller. Otherwise, this property contains the primary view controller.

In a column-style split view controller, it’s recommended that you set the child view controllers using the [`setViewController(_:for:)`](/documentation/UIKit/UISplitViewController/setViewController(_:for:)) method and get them using the [`viewController(for:)`](/documentation/UIKit/UISplitViewController/viewController(for:)) method.

In a classic split view controller, you can use this property to assign the primary and secondary view controllers that you want to display initially. After the split view controller is onscreen, you can use this property to get the view controllers in the split view interface. After you assign the initial view controllers, it’s better to set the child view controllers using the [`show(_:sender:)`](/documentation/UIKit/UISplitViewController/show(_:sender:)) and [`showDetailViewController(_:sender:)`](/documentation/UIKit/UISplitViewController/showDetailViewController(_:sender:)) methods. Although you can still change the view controllers in this property directly, you should do so only if you manually manage your app’s view controller transitions.

## See Also

[`showDetailViewController(_:sender:)`](/documentation/UIKit/UISplitViewController/showDetailViewController(_:sender:))

Presents the specified view controller as the secondary view controller of the split view interface.

[`show(_:sender:)`](/documentation/UIKit/UISplitViewController/show(_:sender:))

Presents the specified view controller as the primary view controller in the split view interface.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)