Skip to content

Instantly share code, notes, and snippets.

@lawgimenez
Created November 25, 2025 00:49
Show Gist options
  • Select an option

  • Save lawgimenez/0202b38c88fa30a3f669468780d535b1 to your computer and use it in GitHub Desktop.

Select an option

Save lawgimenez/0202b38c88fa30a3f669468780d535b1 to your computer and use it in GitHub Desktop.
Pinned views inside List
fileprivate extension ScrollGeometry {
var offsetY: CGFloat {
contentOffset.y + contentInsets.top
}
}
...
.onScrollGeometryChange(for: ScrollGeometry.self, of: {$0}, action: { oldValue, newValue in
scrollProperties = newValue
})
...
.safeAreaInset(edge: .top) {
Picker...
.offset(y: scrollProperties.offsetY < 0 ? -scrollProperties.offsetY: 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment