Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/siteline/SwiftUIRefresh
Pull To Refresh for SwiftUI lists
https://github.com/siteline/SwiftUIRefresh
Last synced: 3 months ago
JSON representation
Pull To Refresh for SwiftUI lists
- Host: GitHub
- URL: https://github.com/siteline/SwiftUIRefresh
- Owner: siteline
- License: mit
- Created: 2019-11-26T00:58:42.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-11-23T14:40:27.000Z (12 months ago)
- Last Synced: 2024-07-19T19:08:09.464Z (4 months ago)
- Language: Swift
- Size: 318 KB
- Stars: 586
- Watchers: 9
- Forks: 56
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
SwiftUI-Refresh
===============Maintainer: [@ldiqual](https://github.com/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 SwiftUIRefreshstruct 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
}
}
}
}
```