Latest 1.0.5
Homepage https://github.com/rushisangani/RSMasterTableView
License GNU GENERAL PUBLIC LICENSE
Platforms ios 9.0, requires ARC
Authors

A powerful UITableView with inbuilt PullToRefresh and Load More (Infinite Scrolling) functionality. RSMasterTableView is built upon [SVPullToRefresh] (https://github.com/samvermette/SVPullToRefresh) for PullToRefresh and Infinite Scrolling.

RSMasterTableView can be used a normal tableView as well as with PullToRefresh and Infinite Scrolling. No need to write complex code to manage data and paging structure.

Features

  • Enable PullToRefresh and Infinite Scrolling using single method.
  • Manage Paging in TableView internally by calling simple methods.

How To Use

Enable PullToRefresh

[self.tableView enablePullToRefreshWithActionHandler:^{

    /* Make your API call here */
    [self fetchDataFromServer];
}];

Enable Load More (Infinite Scrolling)

[self.tableView enableInfiniteScrollingWithActionHandler:^{

    /* Make your API call here */
    [self fetchDataFromServer];
}];

Usage

#pragma mark- TableView Setup

-(void)configureTableView {

    /* setup tableView */

    [self.tableView setupTableViewCellConfiguration:^(id cell, id object, NSIndexPath *indexPath) {

        /* set data to TableView cell */

    } forCellIdentifier:@"cell"];

    /* enable Infinite Scrolling */

    [self.tableView enableInfiniteScrollingWithActionHandler:^{

        /* Make your API call here */
        [self fetchDataFromServer];
    }];

    /* modify statIndex, records per page etc */

    self.tableView.startIndex = 1;
    self.tableView.recordsPerPage = 20;
    self.tableView.noDataFoundMessage = @"No Records found";
}

-(void)fetchDataFromServer {

    /* send request here */

    id response;  /* get response here */

    [self didGetResponseFromServer:response];
}

#pragma mark- Success

-(void)didGetResponseFromServer:(id)response {

    /* inform tableview about data array and total pages */

    NSMutableArray *array = response;
    NSUInteger totalDatacount = 100;    /* get total count from server */

    [self.tableView didCompleteFetchData:array withTotalCount:totalDatacount];
}

#pragma mark- Failure

-(void)didFailToGetData {

    /* inform tableview in failure */

    [self.tableView didFailToFetchdata];
}

License

RSMasterTableView is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "RSMasterTableView",
    "version": "1.0.5",
    "requires_arc": true,
    "summary": "A powerful UITableView with inbuilt PullToRefresh and Load More functionality.",
    "description": "RSMasterTableView can be used a normal tableView as well as with PullToRefresh and Infinite Scrolling. No need to write complex code to manage data and paging structure",
    "homepage": "https://github.com/rushisangani/RSMasterTableView",
    "license": {
        "type": "GNU GENERAL PUBLIC LICENSE",
        "file": "LICENSE"
    },
    "authors": {
        "Rushi Sangani": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/rushisangani/RSMasterTableView.git",
        "tag": "1.0.5"
    },
    "source_files": "RSMasterTableView/**/*.{h,m}"
}

Pin It on Pinterest

Share This