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

Question: how can I use this library to dismiss a few on the pull down? #16

Closed missphyrgames closed 5 months ago

missphyrgames commented 5 months ago

Hey, firstly, thank you for creating this library and also writing up an informative blog post! I found it very interesting. I'm a beginner in swiftui so apologies if this is something that's easy to do.

I'm trying to dismiss a view when you reach the top of the scrollview (similar to how the netflix app does it, where you can scroll the list and then you can reach to the top without it dismissing, but if you then pull down again, it will dismiss the view). Would really appreciate any pointers and advice you can give!

danielsaidi commented 5 months ago

Hi @missphyrgames

SwiftUI has built-in support for this. Just present your screen in a sheet, and you'll get that behavior.

Netflix are smart to use dark mode to make it less obvious that the movie screen is in a sheet.