Skip to content

Instantly share code, notes, and snippets.

View realityworks's full-sized avatar
🎯
Focusing

Realityworks realityworks

🎯
Focusing
View GitHub Profile
// 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)