Swiftpack.co - siteline/SwiftUIRefresh as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by siteline.
siteline/SwiftUIRefresh 0.0.3
Pull To Refresh for SwiftUI lists
⭐️ 375
🕓 1 week ago
iOS
.package(url: "https://github.com/siteline/SwiftUIRefresh.git", from: "0.0.3")

SwiftUI-Refresh

Maintainer: @ldiqual

Native Pull To Refresh in SwiftUI.

What is this?

SwiftUI-Refresh adds a native UIRefreshControl to a SwiftUI List view. It does this by introspecting the view hierarchy to find the relevant UITableView, then adding a refresh control to it.

Demo

Install

SwiftPM

https://github.com/timbersoftware/SwiftUIRefresh.git

Cocoapods

pod "SwiftUIRefresh"

Usage

import SwiftUI
import SwiftUIRefresh

struct ContentView: View {
    
    @State private var isShowing = false
    var body: some View {
        List {
            Text("Item 1")
            Text("Item 2")
        }
        .pullToRefresh(isShowing: $isShowing) {
            DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
                self.isShowing = false
            }
        }
    }
}

GitHub

link
Stars: 375
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Related Packages

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