<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/webViewOnScrollGeometryChange(for:of:action:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewP08_WebKit_aB0E03webC22OnScrollGeometryChange3for2of6actionQrqd__m_qd__AA0hI0Vcyqd___qd__tctSHRd__lF"
  },
  "title" : "webViewOnScrollGeometryChange(for:of:action:)"
}
-->

# webViewOnScrollGeometryChange(for:of:action:)

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

```
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 [`ScrollGeometry`](/documentation/SwiftUI/ScrollGeometry).

`transform`

A closure that transforms a [`ScrollGeometry`](/documentation/SwiftUI/ScrollGeometry) to your type.

`action`

A closure to run when the transformed data changes.

## Return Value

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

## 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.

---

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)