Swiftpack.co - gualtierofrigerio/GFRefreshableScrollView as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by gualtierofrigerio.
gualtierofrigerio/GFRefreshableScrollView 0.1.0
Implementation of pull down to refresh in SwiftUI compatible with iOS 13.
⭐️ 1
🕓 2 years ago
.package(url: "https://github.com/gualtierofrigerio/GFRefreshableScrollView.git", from: "0.1.0")

GFRefreshableScrollView

Implementation of pull down to refresh in SwiftUI compatible with iOS 13.

You can use it as a modifier to your existing views

var body: some View {
    LazyVStack {
        if isLoading {
            ProgressView()
        }
        ForEach(posts) { post in
            PostView(post: post)
        }
    }
    .modifier(GFRefreshableScrollViewModifier(action: refreshAction))
}

Or use it instead of a ScrollView

var body: some View {
    GFRefreshableScrollView(action: refreshList) {
        if isLoading {
            VStack {
                ProgressView()
                Text("loading...")
            }
        }
        VStack {
            ForEach(posts) { post in
                PostView(post: post)
            }
        }
    }
}

If you want to find out more about the implementation please refer to my blog post

License

GFRefreshableScrollView is available under the MIT license. See the LICENSE file for more info.

GitHub

link
Stars: 1
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics