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

# setContentOffset(_:animated:)

Sets the point at which the origin of the content view is offset from the origin of the scroll view.

```
func setContentOffset(_ contentOffset: CGPoint, animated: Bool)
```

## Parameters

`contentOffset`

A point (expressed in points) that’s offset from the content view’s origin.

`animated`

<doc://com.apple.documentation/documentation/Swift/true> to animate the transition at a constant velocity to the new offset, <doc://com.apple.documentation/documentation/Swift/false> to make the transition immediate.

---

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)