1 Star 0 Fork 0

519124189@qq.com / Refresh

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 2.44 KB
一键复制 编辑 原始数据 按行查看 历史
森仔 提交于 2020-10-30 17:00 . feat: change to support ScrollView

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.

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/iampaopaoyu/Refresh.git
git@gitee.com:iampaopaoyu/Refresh.git
iampaopaoyu
Refresh
Refresh
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891