<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIViewController/childContaining(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIViewController(im)childViewControllerContainingSegueSource:"
  },
  "title" : "childContaining(_:)"
}
-->

# childContaining(_:)

Returns the child view controller that contains the source of the unwind segue.

```
func childContaining(_ source: UIStoryboardUnwindSegueSource) -> UIViewController?
```

## Parameters

`source`

The unwind segue source object containing information about the unwind segue.

## Return Value

The view controller that contains the segue source.

## Discussion

Container view controllers call this method to identify the child view controller that is the source of the unwind segue. Typically, you call this method from your [`allowedChildrenForUnwinding(from:)`](/documentation/UIKit/UIViewController/allowedChildrenForUnwinding(from:)) method so that you can remove the corresponding view controller from the returned list of children.

---

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)