This file contains 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
// Authoer: The SwiftUI Lab | |
// Full article: https://swiftui-lab.com/scrollview-pull-to-refresh/ | |
import SwiftUI | |
struct RefreshableScrollView<Content: View>: View { | |
@State private var previousScrollOffset: CGFloat = 0 | |
@State private var scrollOffset: CGFloat = 0 | |
@State private var frozen: Bool = false | |
@State private var rotation: Angle = .degrees(0) |