<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: -",
    "tvOS: 15.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIViewController/setContentScrollView(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "s:So16UIViewControllerC5UIKitE20setContentScrollViewyySo08UIScrollG0CSgF"
  },
  "title" : "setContentScrollView(_:)"
}
-->

# setContentScrollView(_:)

Sets the scroll view that bars observe for all edges of the view.

```
@MainActor @preconcurrency func setContentScrollView(_ scrollView: UIScrollView?)
```

## Parameters

`scrollView`

The scroll view to observe.

## Discussion

Calling this convenience method is identical to calling [`setContentScrollView(_:for:)`](/documentation/UIKit/UIViewController/setContentScrollView(_:for:)) and passing [`all`](/documentation/UIKit/NSDirectionalRectEdge/all) for the `edge` parameter.

---

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)