Skip to content

A simple 'Table View Pager' for iOS which is inspired by Android's view pager.

License

Notifications You must be signed in to change notification settings

SandeepAggarwal/TableViewPager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table View Pager for iOS

CocoaPods Compatible Platform License

A simple 'Table View Pager' for iOS which is inspired by Android's view pager. It is useful for applications having requirement of multiple table views which requires switching with the help of different tabs in one ViewController.

Slide through the table views with beautiful transitions!!

Table-View-Pager

Installation with CocoaPods

Podfile

pod "TableViewPager"

Usage

#import <TableViewPager/TableViewPagerViewController.h>

Initialize table views

UITableView* v1=[[UITableView alloc] init];
UITableView* v2=[[UITableView alloc] init];
UITableView* v3=[[UITableView alloc] init];
UITableView* v4=[[UITableView alloc] init];
UITableView* v5=[[UITableView alloc] init];

Initialize TableViewPagerViewController

TableViewPagerViewController *container = [[TableViewPagerViewController alloc] initWithElementsName:@[@"ONE",@"TWO",@"THREE",@"FOUR",@"FIVE"] colors:@[ONE_TAB_COLOR,TWO_TAB_COLOR,THREE_TAB_COLOR,FOUR_TAB_COLOR,FIVE_TAB_COLOR] tableViews:@[v1,v2,v3,v4,v5]];
    [self addChildViewController:container];
    [self.view addSubview:container.view];
    [container didMoveToParentViewController:self];
    container.delegate=self;

Methods

TableViewPagerViewController will alert your delegate object via - loadDataForElementIndex: method, so that you can do something useful upon changing the tab

#pragma mark -TableViewPagerViewControllerDelegate
-(void)loadDataForElementIndex:(NSInteger)index
{
   /*
   index=0, for first tab
   index=1 , for second tab
   
   and so on..
   */
}

Requirements

ViewPager supports minimum iOS 7 and uses ARC.

Supports both iPhone and iPad.

Contact

@sandeepCool77

Sandeep Aggarwal

License

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

About

A simple 'Table View Pager' for iOS which is inspired by Android's view pager.

Resources

License

Stars

Watchers

Forks

Packages

No packages published