<!--
{
  "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/scrollViewShouldScrollToTop(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIScrollViewDelegate(im)scrollViewShouldScrollToTop:"
  },
  "title" : "scrollViewShouldScrollToTop(_:)"
}
-->

# scrollViewShouldScrollToTop(_:)

Asks the delegate if the scroll view should scroll to the top of the content.

```
optional func scrollViewShouldScrollToTop(_ scrollView: UIScrollView) -> Bool
```

## Parameters

`scrollView`

The scroll-view object requesting this information.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> to permit scrolling to the top of the content, <doc://com.apple.documentation/documentation/Swift/false> to disallow it.

## Discussion

If the delegate doesn’t implement this method, <doc://com.apple.documentation/documentation/Swift/true> is assumed. For the scroll-to-top gesture (a tap on the status bar) to be effective, the [`scrollsToTop`](/documentation/UIKit/UIScrollView/scrollsToTop) property of the [`UIScrollView`](/documentation/UIKit/UIScrollView) must be set to <doc://com.apple.documentation/documentation/Swift/true>.

---

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)