Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/geri-borbas/ios.package.refreshable
✳️ SwiftUI Pull to Refresh (for iOS 13 and iOS 14) package.
https://github.com/geri-borbas/ios.package.refreshable
async-await ios pull-to-refresh refreshable scrollview swift swift-package swift-package-manager swiftui uikit uirefreshcontrol uiscrollview
Last synced: about 1 month ago
JSON representation
✳️ SwiftUI Pull to Refresh (for iOS 13 and iOS 14) package.
- Host: GitHub
- URL: https://github.com/geri-borbas/ios.package.refreshable
- Owner: Geri-Borbas
- License: mit
- Created: 2022-03-29T23:25:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-03-31T10:13:25.000Z (over 2 years ago)
- Last Synced: 2024-10-16T07:01:41.158Z (2 months ago)
- Topics: async-await, ios, pull-to-refresh, refreshable, scrollview, swift, swift-package, swift-package-manager, swiftui, uikit, uirefreshcontrol, uiscrollview
- Language: Swift
- Homepage: https://blog.eppz.eu/swiftui-pull-to-refresh/
- Size: 9.77 KB
- Stars: 37
- Watchers: 1
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Refreshable
✳️ SwiftUI Pull to Refresh (for iOS 13 and iOS 14) package.See complementary article at [SwiftUI Pull to Refresh (for iOS 13 and iOS 14)]. With this extension you can **backport the iOS 15 refreshable modifier to iOS 13 and iOS 14**, and use the exact same code across the board.
https://user-images.githubusercontent.com/1779614/160678139-6f16e4e5-2ec6-4dd6-8f79-87fcdcb05df6.mp4
```Swift
struct ContentView: View {
...
var body: some View {
List {
...
}
.refreshable {
await viewModel.fetch()
}
}
}
```Alternatively, you can opt into the **closure-based API** below to spare using async await API.
```Swift
struct ContentView: View {
...
var body: some View {
List {
...
}
.onRefresh { refreshControl in
viewModel.fetch {
refreshControl.endRefreshing()
}
}
}
}
```## License
> Licensed under the [**MIT License**](https://en.wikipedia.org/wiki/MIT_License).
[SwiftUI Pull to Refresh (for iOS 13 and iOS 14)]: https://blog.eppz.eu/swiftui-pull-to-refresh/