danielsaidi / ScrollKit

ScrollKit is a SwiftUI SDK that adds powerful scroll features, like offset tracking and a header view that stretches & transforms as you pull down, and sticks to the top when you scroll.
MIT License
668 stars 24 forks source link

How to set initial offset for ScrollViewWithOffsetTracking #15

Open codetiger opened 5 months ago

codetiger commented 5 months ago

I am using ScrollViewWithOffsetTracking and want to set the initial scroll offset to a different value than 0. How can I do this?

danielsaidi commented 5 months ago

Hi @codetiger

I haven't tried, but can you wrap it in a ScrollViewReader and use that proxy to scroll?

codetiger commented 5 months ago

scroll to a particular id is possible, but I want to scroll to an offset. I am using this for a sliding ruler where user can select a floating point number

danielsaidi commented 5 months ago

There's no built-in support for that, but I'd be happy to merge anything you come up with :)