<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIScrollViewDelegate/viewForZooming(in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIScrollViewDelegate(im)viewForZoomingInScrollView:"
  },
  "title" : "viewForZooming(in:)"
}
-->

# viewForZooming(in:)

Asks the delegate for the view to scale when zooming is about to occur in the scroll view.

```
optional func viewForZooming(in scrollView: UIScrollView) -> UIView?
```

## Parameters

`scrollView`

The scroll-view object displaying the content view.

## Return Value

A [`UIView`](/documentation/UIKit/UIView) object that will be scaled as a result of the zooming gesture. Return `nil` if you don’t want zooming to occur.

## Discussion

---

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)