# Whats different on this fork:
- Easy integration, the table view can be added and configured using interface builder.
- Easy configuration, the arrow image, background color and text color can simply be changed by properties of the PullTableView class.
- *Pull to reload more data* functionality at the bottom of the table.
- Possibility to trigger the *refreshing* and *loading more* animations by code.
# The fast setup:
- Add QuartzCore.framework to your project
- Drag drop EGOTableViewPullRefresh directory to your project.
- Look at the PullTableView.h file for available properties.
- Add a PullTableView to your code and implement the PullTableViewDelegate methods.
- Enjoy!
# The detailed setup (Walk through for creating the demo project):
- Create a new Xcode project
- Choose *View Based Application*
- Product name: EGOTableViewPullRefreshDemo
- Create it in desired folder
- Add *QuartzCore.framework* to the project
**Adding the PullTableView to the project:**
- Drag drop EGOTableViewPullRefresh directory to the Supporting Files group in the project, make sure items are copied into destination groups folder.
**Adding the PullTable to the view `EGOTableViewPullRefreshDemoViewController.xib`:**
- Drag drop a UITableView to the view.
- Open the *Identity inspector* and change the Class from 'UITableView' to PullTableView
- Connect the dataSource and pullDelegate outlets of the PullTableView to File's owner
**Configuring view controller Header `EGOTableViewPullRefreshDemoViewController.h`:**
- Add `#import "PullTableView.h"`
- Make it conform to PullTableViewDelegate and UITableViewDataSource
- Create an outlet property named pullTableView and connect it to the table in interface builder.
**Configuring view controller Footer `EGOTableViewPullRefreshDemoViewController.m`**
- Add the following code to the m file.
#pragma mark - Refresh and load more methods
- (void) refreshTable
{
/*
Code to actually refresh goes here.
*/
self.pullTableView.pullLastRefreshDate = [NSDate date];
self.pullTableView.pullTableIsRefreshing = NO;
}
- (void) loadMoreDataToTable
{
/*
Code to actually load more data goes here.
*/
self.pullTableView.pullTableIsLoadingMore = NO;
}
#pragma mark - UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 5;
}
- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 10;
}
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if(!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
}
cell.textLabel.text = [NSString stringWithFormat:@"Row %i", indexPath.row];
return cell;
}
- (NSString *) tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
return [NSString stringWithFormat:@"Section %i begins here!", section];
}
- (NSString *) tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section
{
return [NSString stringWithFormat:@"Section %i ends here!", section];
}
#pragma mark - PullTableViewDelegate
- (void)pullTableViewDidTriggerRefresh:(PullTableView *)pullTableView
{
[self performSelector:@selector(refreshTable) withObject:nil afterDelay:3.0f];
}
- (void)pullTableViewDidTriggerLoadMore:(PullTableView *)pullTableView
{
[self performSelector:@selector(loadMoreDataToTable) withObject:nil afterDelay:3.0f];
}
- For UI configuration add the following code inside viewDidLoad
self.pullTableView.pullArrowImage = [UIImage imageNamed:@"blackArrow"];
self.pullTableView.pullBackgroundColor = [UIColor yellowColor];
self.pullTableView.pullTextColor = [UIColor blackColor];
- For manually triggering animation use the pullTableIsRefreshing and pullTableIsLoadingMore properties. For example add the following code to viewWillAppear:
if(!self.pullTableView.pullTableIsRefreshing) {
self.pullTableView.pullTableIsRefreshing = YES;
[self performSelector:@selector(refreshTable) withObject:nil afterDelay:3];
}
没有合适的资源?快使用搜索试试~ 我知道了~
下拉刷新EGOTableViewPullRefresh
共29个文件
png:8个
m:7个
h:6个
5星 · 超过95%的资源 需积分: 10 20 下载量 134 浏览量
2013-04-06
12:50:43
上传
评论
收藏 56KB ZIP 举报
温馨提示
ios的一个简单的下拉上拉刷新demo,用的是第三方类库, 从github下载的,与大家共分享,TableViewPullRefresh
资源推荐
资源详情
资源评论
收起资源包目录
EGOTableViewPullRefresh-master.zip (29个子文件)
EGOTableViewPullRefresh-master
.gitignore 241B
EGOTableViewPullRefresh
Resources
blackArrow@2x.png 2KB
blueArrow@2x.png 1KB
grayArrow@2x.png 2KB
blackArrow.png 4KB
whiteArrow.png 4KB
whiteArrow@2x.png 2KB
grayArrow.png 2KB
blueArrow.png 4KB
Classes
EGORefreshTableHeaderView.m 11KB
EGORefreshTableHeaderView.h 3KB
PullTableView.h 3KB
PullTableView.m 8KB
MessageInterceptor.m 2KB
LoadMoreTableFooterView.h 2KB
MessageInterceptor.h 2KB
LoadMoreTableFooterView.m 8KB
README.md 5KB
EGOTableViewPullRefreshDemo
EGOTableViewPullRefreshDemo
EGOTableViewPullRefreshDemo-Info.plist 1KB
EGOTableViewPullRefreshDemo-Prefix.pch 360B
en.lproj
MainWindow.xib 20KB
EGOTableViewPullRefreshDemoViewController.xib 9KB
InfoPlist.strings 45B
EGOTableViewPullRefreshDemoViewController.m 3KB
EGOTableViewPullRefreshDemoAppDelegate.m 2KB
EGOTableViewPullRefreshDemoAppDelegate.h 518B
main.m 383B
EGOTableViewPullRefreshDemoViewController.h 480B
EGOTableViewPullRefreshDemo.xcodeproj
project.pbxproj 20KB
共 29 条
- 1
资源评论
- Shandy1972_2013-05-09非常好用,谢谢分享,提醒大家使用的时候不要忘了设置pullDelegate为self,否则会一直处于加载或更新状态。
- Larry_qidian2013-10-29不错的.能用的
wwwang89123
- 粉丝: 122
- 资源: 25
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于python编写的Keras深度学习框架开发,利用卷积神经网络CNN,快速识别图片并进行分类
- 最全空间计量实证方法(空间杜宾模型和检验以及结果解释文档).txt
- 5uonly.apk
- 蓝桥杯Python组的历年真题
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 前端开发技术实验报告:内含4四实验&实验报告
- Highlight Plus v20.0.1
- 林周瑜-论文.docx
- 基于MIC+NE555光敏电阻的声光控电路Multisim仿真原理图
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功