---
title: "webViewOnScrollGeometryChange(for:of:action:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/webviewonscrollgeometrychange(for:of:action:)"
---

# webViewOnScrollGeometryChange(for:of:action:)

Adds an action to be performed when a value, created from a scroll geometry, changes.

## Declaration

```swift
nonisolated func webViewOnScrollGeometryChange<T>(for type: T.Type, of transform: @escaping (ScrollGeometry) -> T, action: @escaping (T, T) -> Void) -> some View where T : Hashable

```

## Parameters

- `type`: The type of value transformed from a doc://com.apple.SwiftUI/documentation/SwiftUI/ScrollGeometry.
- `transform`: A closure that transforms a doc://com.apple.SwiftUI/documentation/SwiftUI/ScrollGeometry to your type.
- `action`: A closure to run when the transformed data changes.

## Return Value

Return Value A view that invokes the action when the relevant part of a web view’s scroll geometry changes.

## Discussion

Discussion note: The content size of web content may exceed the current size of the view’s frame, however it will never be smaller than it.

## See Also

### Displaying web content

- [WebView](webkit/webview-swift.struct.md)
- [WebPage](webkit/webpage.md)
- [onWebViewImmersiveEnvironmentRequest(shouldAllow:present:dismiss:)](swiftui/view/onwebviewimmersiveenvironmentrequest(shouldallow:present:dismiss:).md)
- [webViewBackForwardNavigationGestures(_:)](swiftui/view/webviewbackforwardnavigationgestures(_:).md)
- [webViewContentBackground(_:)](swiftui/view/webviewcontentbackground(_:).md)
- [webViewContextMenu(menu:)](swiftui/view/webviewcontextmenu(menu:).md)
- [webViewElementFullscreenBehavior(_:)](swiftui/view/webviewelementfullscreenbehavior(_:).md)
- [webViewLinkPreviews(_:)](swiftui/view/webviewlinkpreviews(_:).md)
- [webViewMagnificationGestures(_:)](swiftui/view/webviewmagnificationgestures(_:).md)
- [webViewScrollInputBehavior(_:for:)](swiftui/view/webviewscrollinputbehavior(_:for:).md)
- [webViewScrollPosition(_:)](swiftui/view/webviewscrollposition(_:).md)
- [webViewTextSelection(_:)](swiftui/view/webviewtextselection(_:).md)
