---
title: "scrollTo(x:y:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/scrollposition/scrollto(x:y:)"
---

# scrollTo(x:y:)

Scrolls the position of the scroll view to the x and y value you provide.

## Declaration

```swift
mutating func scrollTo(x: CGFloat, y: CGFloat)
```

## Discussion

Discussion The scroll view will clamp this value to only scroll to the size of its actual content.
