Swiftpack.co - wxxsw/Refresh as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
wxxsw/Refresh
🎈 Great SwiftUI drop-down refresh and scroll up to load more. δΈ‹ζ‹‰εˆ·ζ–°γ€δΈŠζ‹‰εŠ θ½½
.package(url: "https://github.com/wxxsw/Refresh.git", from: "0.1")

Refresh

codebeat badge


Demo

Open Refresh.xcodeproj and run Demo target.

Features

  • β˜‘ Support drop-down refresh and scroll up to load more.
  • β˜‘ Fully based on SwiftUI, no UIViewRepresentable, no UIViewControllerRepresentable.
  • β˜‘ Compatible with NavigationView, TabView.
  • β˜‘ Fully customizable UI.
  • β˜‘ Easy to animate.
  • β˜‘ Simple API.

Usage

ScrollView {
    RefreshHeader(refreshing: $headerRefreshing, action: {
        self.reload()
    }) { progress in
        if self.headerRefreshing {
            Text("refreshing...")
        } else {
            Text("Pull to refresh")
        }
    }

    ForEach(items) { item in
        YourCell(item: item)
    }

    RefreshFooter(refreshing: $footerRefreshing, action: {
        self.loadMore()
    }) {
        if self.noMore {
            Text("No more data !")
        } else {
            Text("refreshing...")
        }
    }
    .noMore(noMore)
    .preload(offset: 50)
}
.enableRefresh()

Installation

Swift Package Manager

  1. Select Xcode -> File -> Swift Packages -> Add Package Dependency...
  2. Enter https://github.com/wxxsw/Refresh.
  3. Click Next, then select the version, complete.

Requirements

  • iOS 13+
  • Xcode 11+
  • Swift 5+

License

Refresh is released under the MIT license. See LICENSE for details.

GitHub

link
Stars: 56
Last commit: 2 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Release Notes

Release 0.1
23 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics