Skip to content
This repository has been archived by the owner on Feb 16, 2022. It is now read-only.
/ SwiftUIRefresh Public archive
forked from siteline/SwiftUIRefresh

Pull To Refresh for SwiftUI lists

License

Notifications You must be signed in to change notification settings

voiapp/SwiftUIRefresh

 
 

Repository files navigation

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
            }
        }
    }
}

About

Pull To Refresh for SwiftUI lists

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 82.4%
  • Ruby 13.6%
  • Objective-C 4.0%