This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import Combine | |
struct OnScroll: ViewModifier { | |
@Binding var offset: CGFloat | |
//we can have a version with a closure instead of the binding, but that triggers an infinite loop if content depends on the same Store | |
// var onOffset: (CGFloat) -> () | |
func body(content: Content) -> some View { | |
return VStack { |