目录
目录README.md

SwiftUIPullToRefresh

SwiftUIPullToRefresh is designed for ‘pull to refresh’ feature for List and ScrollView elements in SwiftUI.

Installation

Swift Package Manager

You should use Xcode 11 to open your project. Click File -> Swift Packages -> Add Package Dependency, enter CocoaPods repo’s URL. Or you can login Xcode with your GitHub account and just type CocoaPods to search.

https://github.com/muhammedtanriverdi/SwiftUIPullToRefresh.git

Usage

ScrollView

    @EnvironmentObject var viewModel: ViewModel

    ScrollView {
            ForEach(viewModel.data) { item in
                ...
            } 
        } 
        .background(SwiftUIPullToRefresh(action: {
            viewModel.reloadData()
        }, isShowing: $viewModel.dataIsLoading))

List

    @EnvironmentObject var viewModel: ViewModel

    List (viewModel.data) { item in
           ...
        } 
        .background(SwiftUIPullToRefresh(action: {
            viewModel.reloadData()
        }, isShowing: $viewModel.dataIsLoading))

Licence

SwiftUIPullToRefresh is available under the MIT license. See the LICENSE file for more info.

关于
44.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号