<!--
{
  "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/UIViewController/show(_:sender:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIViewController(im)showViewController:sender:"
  },
  "title" : "show(_:sender:)"
}
-->

# show(_:sender:)

Presents a view controller in a primary context.

```
func show(_ vc: UIViewController, sender: Any?)
```

## Parameters

`vc`

The view controller to display.

`sender`

The object that initiated the request.

## Discussion

You use this method to decouple the need to display a view controller from the process of actually presenting that view controller onscreen. Using this method, a view controller does not need to know whether it is embedded inside a navigation controller or split-view controller. It calls the same method for both. The [`UISplitViewController`](/documentation/UIKit/UISplitViewController) and [`UINavigationController`](/documentation/UIKit/UINavigationController) classes override this method and handle the presentation according to their design. For example, a navigation controller overrides this method and uses it to push `vc` onto its navigation stack.

The default implementation of this method calls the [`targetViewController(forAction:sender:)`](/documentation/UIKit/UIViewController/targetViewController(forAction:sender:)) method to locate an object in the view controller hierarchy that overrides this method. It then calls the method on that target object, which displays the view controller in an appropriate way. If the [`targetViewController(forAction:sender:)`](/documentation/UIKit/UIViewController/targetViewController(forAction:sender:)) method returns `nil`, this method uses the window’s root view controller to present `vc` modally.

You can override this method in custom view controllers to display `vc` yourself. Use this method to display `vc` in a primary context. For example, a container view controller might use this method to replace its primary child. Your implementation should adapt its behavior for both regular and compact environments.

---

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)