---
title: "parentScrollView(for:)"
framework: browserenginekit
role: symbol
role_heading: Instance Method
path: "browserenginekit/bescrollviewdelegate/parentscrollview(for:)"
---

# parentScrollView(for:)

Returns the scroll view that acts as the DOM container of the given scroll view.

## Declaration

```swift
optional func parentScrollView(for scrollView: BEScrollView) -> BEScrollView?
```

## Parameters

- `scrollView`: The scroll view for which to return the logically containing scroll view.

## Return Value

Return Value The scroll view that is the logical DOM container of the provided scroll view. Return nil to get the default behavior, where the system recursively searches the scroll view’s superview hierarchy for a containing scroll view.

## Discussion

Discussion To correctly render some websites, you may need to create BEScrollView objects that are siblings in the view hierarchy but nested in the DOM. In these situations, implement this method in the delegate of the logically contained scroll view, and return the logically containing scroll view. The containing scroll view must appear visually beneath the contained scroll view.
