ScrollViewReactiveHeader

1.0.1

ScrollView that supports a parallax header image and static overlay.
swiftui-library/scrollview-reactive-header

What's New

1.0.1

2021-11-10T15:11:14Z

Sets backgroundColor of ScrollViewConfiguration to nil by default. Thanks to Flo for this commit!

ScrollViewReactiveHeader

A replacement ScrollView that provides a header with subtle scroll animations.

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))

Future Todos

  • Make headerOverlay interactive. At the moment, taps will be blocked by the overlaid ScrollView
  • Add optional callback that reports internally-calculated scroll offset.
  • Remove dependency on GeometryReader for 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. )

Description

  • Swift Tools 5.3.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sat Dec 31 2022 17:58:33 GMT-0500 (GMT-05:00)