Skip to content

Commit 7e7073d

Browse files
authored
Fix variable name in README.md example
Merge pull request #30 from bzf/patch-1
2 parents ba0e1cc + 3522771 commit 7e7073d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,14 @@ ScrollViewWithOffsetTracking { offset in
4949
ScrollKit has a `ScrollViewWithStickyHeader` that makes it easy to set up a stretchy, sticky header:
5050

5151
```swift
52+
import SwiftUI
53+
import ScrollKit
54+
5255
struct MyView: View {
5356

5457
@State
55-
private var offset = CGPoint.zero
56-
58+
private var scrollOffset = CGPoint.zero
59+
5760
@State
5861
private var visibleRatio = CGFloat.zero
5962

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

0 commit comments

Comments
 (0)