Giter Site home page Giter Site logo

swqqcs / syrefreshtable Goto Github PK

View Code? Open in Web Editor NEW

This project forked from reesun1130/syrefreshtable

0.0 2.0 0.0 206 KB

简单易用的上拉加载、下拉刷新组件,可自定义头部和底部视图,可单独实现下拉刷新,上拉加载更多。用法:/** * * SEE SYRefreshTable (https://github.com/reesun1130/SYRefreshTable) for instructions. * * USE SYRefreshTable LIKE: * * @interface ViewController : SYTableViewController * * OVERRIDE refresh、loadMore、scrollViewDidScroll * */

Objective-C 100.00%

syrefreshtable's Introduction

SYRefreshTable

简单易用的上拉加载、下拉刷新组件,可自定义头部和底部视图,可单独实现下拉刷新,上拉加载更多。

用法:(具体请查看DEMO)

/** SEE SYRefreshTable (https://github.com/reesun1130/SYRefreshTable) for instructions.
* USE SYRefreshTable LIKE:
* @interface ViewController : SYTableViewController
* OVERRIDE refresh、loadMore、scrollViewDidScroll
*/

////////// 只需实现这三个方法 即可实现下拉刷新,上拉加载更多 #Pull to Refresh

*  - (BOOL)refresh
   {
      if (![super refresh])
         return NO;
      
      self.pageCount = 1;
      
      [lockLoadData lock];
      [self performSelector:@selector(loadItemData) withObject:nil afterDelay:0.01];
      [lockLoadData unlock];
      
      return YES;
   }

#Load More

*  - (BOOL)loadMore
   {
       if (![super loadMore])
          return NO;
       
       self.pageCount ++;

       [lockLoadData lock];
       [self performSelector:@selector(loadItemData) withObject:nil afterDelay:0.01];
       [lockLoadData unlock];

       return YES;
   }

#UIScrollViewDelegate Method

*  - (void)scrollViewDidScroll:(UIScrollView *)scrollView
   {
      [super scrollViewDidScroll:scrollView];
   }

////////// 只需实现这三个方法 即可实现下拉刷新,上拉加载更多

效果如下:

image

syrefreshtable's People

Contributors

reesun1130 avatar

Watchers

James Cloos 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.