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!!
pod "TableViewPager"
#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;
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..
*/
}
ViewPager supports minimum iOS 7 and uses ARC.
Supports both iPhone and iPad.
TableViewPager is released under the MIT license. See LICENSE for details.