Git Product home page Git Product logo

refresh's Introduction

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: reload) { progress in
        if self.headerRefreshing {
            Text("refreshing...")
        } else {
            Text("Pull to refresh")
        }
    }

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

    RefreshFooter(refreshing: $footerRefreshing, action: 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.

refresh's People

Contributors

wxxsw avatar iostang avatar markgravity avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.