Skip to content

agelessman/MCSwiftUIRefresh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MCSwiftUIRefresh

Implement pull-down refresh in SwiftUI

Kapture 2020-07-20 at 9.45.36.gif

企业微信截图_fa5a3d8b-c6d2-45b4-bbfc-a11dc6e1eece.png

Usage

struct ContentView: View {
    @StateObject private var model = MyTestModel()

    var body: some View {
        NavigationView {
            MCRefreshableVerticalScrollView(refreshing: self.$model.loading) {
                VStack(spacing: 0) {
                    ForEach(model.articleArray) { article in
                        Row(article: article)
                    }
                }
            }
            .navigationBarTitle("我的文章", displayMode: .inline)
        }
    }
}

If you want to customize the head refresh control, you can directly modify the RefreshHeader

About

Implement pull-down refresh in SwiftUI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages