KenanAtmaca / RefreshScrollView

SwiftUI async custom refreshable ScrollView

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RefreshScrollView

SwiftUI async custom refreshable ScrollView

Usage

struct ContentView: View {

    var body: some View {
        RefreshScrollView(type: .progress) {
            // Content
            Text("Hello World!")
        } onRefresh: {
            await fetchService()
        }
    }

    func fetchService() async {
        try? await Task.sleep(nanoseconds: 2_000_000_000)
    }
}

About

SwiftUI async custom refreshable ScrollView

License:MIT License


Languages

Language:Swift 100.0%