<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UISplitViewControllerDelegate/splitViewController(_:separateSecondaryFrom:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UISplitViewControllerDelegate(im)splitViewController:separateSecondaryViewControllerFromPrimaryViewController:"
  },
  "title" : "splitViewController(_:separateSecondaryFrom:)"
}
-->

# splitViewController(_:separateSecondaryFrom:)

Asks the delegate to provide the new secondary view controller for the split view interface.

```
optional func splitViewController(_ splitViewController: UISplitViewController, separateSecondaryFrom primaryViewController: UIViewController) -> UIViewController?
```

## Parameters

`splitViewController`

The split view controller whose interface is expanding.

`primaryViewController`

The primary view controller in the expanded split view interface. If you implement the [`primaryViewController(forExpanding:)`](/documentation/UIKit/UISplitViewControllerDelegate/primaryViewController(forExpanding:)) method in your delegate, this object is the one that method returns.

## Return Value

The view controller to use as the secondary view controller in the expanded split view interface, or `nil` to let the split view controller choose an appropriate secondary view controller for you.

## Discussion

This delegate method only applies to classic split view interfaces. For more information, see [`Split view styles`](/documentation/UIKit/UISplitViewController#Split-view-styles).

Use this method to designate the secondary view controller for your split view interface and to perform any additional cleanup that might be needed. After this method returns, the split view controller installs the newly designated primary and secondary view controllers in its [`viewControllers`](/documentation/UIKit/UISplitViewController/viewControllers) array.

When an interface collapses, some view controllers merge the contents of the primary and secondary view controllers. This method is your opportunity to undo those changes and return your split view interface to its original state.

When you return `nil` from this method, the split view controller calls the primary view controller’s [`separateSecondaryViewController(for:)`](/documentation/UIKit/UIViewController/separateSecondaryViewController(for:)) method, giving it a chance to designate an appropriate secondary view controller. Most view controllers do nothing by default but the [`UINavigationController`](/documentation/UIKit/UINavigationController) class responds by popping and returning the view controller from the top of its navigation stack.

---

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)