Skip to content

Fix variable name in README.md example #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,14 @@ ScrollViewWithOffsetTracking { offset in
ScrollKit has a `ScrollViewWithStickyHeader` that makes it easy to set up a stretchy, sticky header:

```swift
import SwiftUI
import ScrollKit

struct MyView: View {

@State
private var offset = CGPoint.zero
private var scrollOffset = CGPoint.zero

@State
private var visibleRatio = CGFloat.zero

Expand All @@ -63,7 +66,7 @@ struct MyView: View {
headerHeight: 250, // The resting header height
headerMinHeight: 150, // The minimum header height
headerStretch: false, // Disables the stretch effect
contentCornerRadius: 20 // An optional corner radius mask
contentCornerRadius: 20, // An optional corner radius mask
onScroll: handleScroll // An optional scroll handler action
) {
// Add your scroll content here, e.g. a `LazyVStack`
Expand All @@ -79,7 +82,7 @@ struct MyView: View {
ZStack {
Color.red
ScrollViewHeaderGradient() // By default a dark gradient
Text("Scroll offset: \(offset.y)")
Text("Scroll offset: \(scrollOffset.y)")
}
}
}
Expand Down