SwiftUIPullToRefresh

master

'pull to refresh' feature in SwiftUI
muhammedtanriverdi/SwiftUIPullToRefresh

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.

Description

  • Swift Tools 5.1.0
View More Packages from this Author

Dependencies

  • None
Last updated: Wed Nov 09 2022 02:54:12 GMT-0500 (GMT-05:00)