Skip to content
This repository was archived by the owner on Apr 16, 2022. It is now read-only.

Latest commit

 

History

History
29 lines (22 loc) · 974 Bytes

File metadata and controls

29 lines (22 loc) · 974 Bytes

SwiftUI-PullToRefresh

Introduction

SwiftUI's ScrollView does not support pull down to refresh, this is a library that adds refresh control to it.

Install

  • Cocoapod. pod SwiftUI-PullToRefresh

  • SPM. https://github.com/YuantongL/SwiftUI-PullToRefresh.git

  • Simply copy the source file under /Source/RefreshableScrollView.swift

Usage

Use the RefreshableScrollView component from this library as below:

@State private var isLoading: Bool = false

RefreshableScrollView(isLoading: $isLoading,
                      onRefresh: {
                        // Update your data and
                        self.isLoading = false
                      },
                      content: {
                          // Draw your content view here
                      })

You can also checkout the example app.