Giter VIP home page Giter VIP logo

jtloadmorecontrol's Introduction

UITableView上拉加载更多的控件。

loadMoreNormal loadMoreFaild loadMoreNoMoreData

安装

Carthage

github "RealMeZJT/JTLoadMoreControl"

手动

  1. 下载 JTLoadMoreControl 仓库
  2. 将名为 JTLoadMoreControl 的子目录拷贝到你的项目中

基本用法

创建一个 JTLoadMoreControl 对象:

var loadMoreControl = JTLoadMoreControl()

将 JTLoadMoreControl 作为 tableView 的 footer:

tableView.tableFooterView = loadMoreControl

当用户滑动到底部时,就会触发上拉刷新事件。监听并处理上拉刷新事件:

override func viewDidLoad() {
	loadMoreControl.addTarget(self, action: #selector(loadingMore), for: .valueChanged)
}
func loadingMore() {
    //在这里请求获取下一页
}

加载完成后,关闭加载动画:

loadMoreControl.endLoading()

加载失败后,停止加载动画,并且提示用户点击重试:

loadMoreControl.endLoadingDueToFailed()

没有更多数据时:

loadMoreControl.endLoadingDueToNoMoreData()

jtloadmorecontrol's People

Contributors

realmezjt avatar

Watchers

 avatar  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.