A replacement ScrollView that provides a header with subtle scroll animations.
To see the rest of the SwiftUI Library, visit our website.
example-video.mov
Using ScrollViewReactiveHeader is easy:
ScrollViewReactiveHeader(header: {
MyHeaderBackground()
.frame(height: 300)
}, headerOverlay: {
MyHeaderContent()
.frame(height: 300)
}, body: {
// Note: This view will be placed inside a ScrollView
MyScrollingContentView()
}, configuration: .init(showStatusBar: true, backgroundColor: .white))- Make
headerOverlayinteractive. At the moment, taps will be blocked by the overlaidScrollView - Add optional callback that reports internally-calculated scroll offset.
- Remove dependency on
GeometryReaderfor calculating status bar height. (at the moment, setting.edgesIgnoringSafeArea(.top)will interfere with this package's ability to calculate the height of the status bar. )