---
title: "setContentOffset(_:animated:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiscrollview/setcontentoffset(_:animated:)"
---

# setContentOffset(_:animated:)

Sets the offset from the content view’s origin that corresponds to the scroll view’s origin.

## Declaration

```swift
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.

## See Also

### Managing the content size and offset

- [contentSize](uikit/uiscrollview/contentsize.md)
- [contentOffset](uikit/uiscrollview/contentoffset.md)
