Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yuantongl/swiftui-pulltorefresh

Pull to refresh ScrillView for SwiftUI
https://github.com/yuantongl/swiftui-pulltorefresh

ios scrollview swiftui

Last synced: 3 months ago
JSON representation

Pull to refresh ScrillView for SwiftUI

Awesome Lists containing this project

README

        

# 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.