├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── RefreshControl ├── Assets │ ├── bicon.png │ ├── bicon@2x.png │ ├── box@2x.png │ ├── dark_circle.png │ ├── dark_circle@2x.png │ ├── deliveryStaff0@2x.png │ ├── deliveryStaff1@2x.png │ ├── deliveryStaff2@2x.png │ ├── deliveryStaff3@2x.png │ ├── light_circle.png │ ├── light_circle@2x.png │ └── staticDeliveryStaff@2x.png ├── Controllers │ ├── CustomTableViewController │ │ ├── XHBaseTableViewController.h │ │ ├── XHBaseTableViewController.m │ │ ├── XHFoundationCommon.h │ │ ├── XHFoundationCommon.m │ │ ├── XHJDPullRefreshTableViewController.h │ │ ├── XHJDPullRefreshTableViewController.m │ │ ├── XHPinterestPullRefreshTableViewController.h │ │ ├── XHPinterestPullRefreshTableViewController.m │ │ ├── XHPullRefreshTableViewController.h │ │ └── XHPullRefreshTableViewController.m │ ├── SystemCollectionViewController │ │ ├── XHSystemCollectionViewController.h │ │ ├── XHSystemCollectionViewController.m │ │ ├── XHSystemRefreshCollectionViewController.h │ │ └── XHSystemRefreshCollectionViewController.m │ └── SystemTableViewController │ │ ├── XHSysatemRefreshTableViewController.h │ │ ├── XHSysatemRefreshTableViewController.m │ │ ├── XHSystemTableViewController.h │ │ └── XHSystemTableViewController.m ├── Manager │ ├── XHRefreshControl.h │ ├── XHRefreshControl.m │ └── XHRefreshControlHeader.h └── Views │ ├── XHActivityCircleIndicatorView.h │ ├── XHActivityCircleIndicatorView.m │ ├── XHActivityIndicatorView.h │ ├── XHActivityIndicatorView.m │ ├── XHCircleView.h │ ├── XHCircleView.m │ ├── XHCircularProgressView.h │ ├── XHCircularProgressView.m │ ├── XHJDRefreshView.h │ ├── XHJDRefreshView.m │ ├── XHLoadMoreView.h │ ├── XHLoadMoreView.m │ ├── XHPinterestRefreshView.h │ ├── XHPinterestRefreshView.m │ ├── XHRefreshActivityIndicatorContainerView.h │ ├── XHRefreshActivityIndicatorContainerView.m │ ├── XHRefreshCircleContainerView.h │ └── XHRefreshCircleContainerView.m ├── XHRefreshControl.podspec └── XHRefreshControlExample ├── XHRefreshControlExample.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── XHRefreshControlExample.xccheckout ├── xcshareddata │ └── xcschemes │ │ └── XHRefreshControlExample.xcscheme └── xcuserdata │ └── JackMacbook.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── XHRefreshControlExample.xcscheme │ └── xcschememanagement.plist ├── XHRefreshControlExample ├── AppDelegate.h ├── AppDelegate.m ├── Controllers │ ├── CollectionViewController │ │ ├── CollectionViewFlowLayout.h │ │ ├── CollectionViewFlowLayout.m │ │ ├── DemoCollectionViewController.h │ │ ├── DemoCollectionViewController.m │ │ └── 奥迪.jpg │ ├── CustomLoadMoreButtonDemoTableViewController │ │ ├── XHCustomLoadMoreButtonDemoTableViewController.h │ │ └── XHCustomLoadMoreButtonDemoTableViewController.m │ ├── DemoSystemTableViewController │ │ ├── XHDemoSystemTableViewController.h │ │ └── XHDemoSystemTableViewController.m │ ├── DemoTableViewController │ │ ├── XHDemoTableViewController.h │ │ └── XHDemoTableViewController.m │ ├── JDRefreshDemoTableViewController │ │ ├── XHJDRefreshDemoTableViewController.h │ │ └── XHJDRefreshDemoTableViewController.m │ ├── PinterestDemoRefreshTableViewController │ │ ├── PinterestDemoRefreshTableViewController.h │ │ └── PinterestDemoRefreshTableViewController.m │ ├── Root │ │ ├── XHRootTableViewController.h │ │ └── XHRootTableViewController.m │ ├── SegmentController │ │ ├── XHSegmentViewController.h │ │ └── XHSegmentViewController.m │ └── SimulationNetEaseNetworkErrorViewController │ │ ├── XHSimulationNetEaseNetworkErrorViewController.h │ │ └── XHSimulationNetEaseNetworkErrorViewController.m ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── Models │ ├── XHSegueItem.h │ └── XHSegueItem.m ├── Vendor │ ├── NSDate+TimeAgo.h │ ├── NSDate+TimeAgo.m │ └── NSDateTimeAgo.bundle │ │ ├── ar.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── bg.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── cs.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── da.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── de.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── en.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── es.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── fi.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── fr.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── gre.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── he.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── hu.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── is.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── it.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── ja.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── ko.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── lv.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── nb.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── nl.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── pl.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── pt-PT.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── pt.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── ro.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── ru.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── sv.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── th.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── tr.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── uk.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── vi.lproj │ │ └── NSDateTimeAgo.strings │ │ ├── zh-Hans.lproj │ │ └── NSDateTimeAgo.strings │ │ └── zh-Hant.lproj │ │ └── NSDateTimeAgo.strings ├── XHRefreshControlExample-Info.plist ├── XHRefreshControlExample-Prefix.pch ├── en.lproj │ └── InfoPlist.strings ├── main.m └── nothing_more_tips@2x.png └── XHRefreshControlExampleTests ├── XHRefreshControlExampleTests-Info.plist ├── XHRefreshControlExampleTests.m └── en.lproj └── InfoPlist.strings /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by http://www.gitignore.io 2 | 3 | #!! ERROR: obj is undefined. Use list command to see defined gitignore types !!# 4 | 5 | ### Objective-C ### 6 | # Xcode 7 | # 8 | build/ 9 | *.xcuserstate 10 | *.xcbkptlist 11 | *.pbxuser 12 | !default.pbxuser 13 | *.mode1v3 14 | !default.mode1v3 15 | *.mode2v3 16 | !default.mode2v3 17 | *.perspectivev3 18 | !default.perspectivev3 19 | xcuserdata 20 | *.xccheckout 21 | *.moved-aside 22 | DerivedData 23 | *.hmap 24 | *.ipa 25 | *.xcuserstate 26 | .DS_Store 27 | 28 | # CocoaPods 29 | # 30 | # We recommend against adding the Pods directory to your .gitignore. However 31 | # you should judge for yourself, the pros and cons are mentioned at: 32 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 33 | # 34 | # Pods/ 35 | *.xcuserstate 36 | 37 | XHRefreshControlExample/XHRefreshControlExample.xcodeproj/project.xcworkspace/xcuserdata/JackMacbook.xcuserdatad/UserInterfaceState.xcuserstate 38 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | osx_image: xcode7 2 | language: objective-c 3 | xcode_project: XHRefreshControlExample/XHRefreshControlExample.xcodeproj 4 | xcode_schemes: XHRefreshControlExample 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Jack 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![image](https://github.com/xhzengAIB/LearnEnglish/raw/master/Screenshots/XHRefreshControl.gif) 2 | XHRefreshControl 3 | ================ 4 | 5 | XHRefreshControl 是一款高扩展性、低耦合度的下拉刷新、上提加载更多的组件。 6 | 7 | 很多朋友反映这个开源用起来并不方便,我暂时想到的解决方案:通过OC的分类特性,使用OC的动态绑定特性来解决这个问题,如果有Block情结的开发者,那是不是可以也加上去呢?当然是比较好的做法。 8 | 总结:使用Category、Runtime以及Block来实现更加方便的使用方法! 9 | 10 | ## Podfile 11 | 12 | [CocosPods](http://cocosPods.org) is the recommended method to install XHRefreshControl, just add the following line to `Podfile` 13 | 14 | ``` 15 | pod 'XHRefreshControl' 16 | ``` 17 | 18 | and run `pod install`, then you're all done! 19 | 20 | ## Requirements 21 | 22 | * Xcode6 or later 23 | * iOS 6.0+ 24 | * ARC 25 | 26 | ## To Do: 27 | * 添加外部自定义下拉View和下拉状态-------已经完成 28 | 29 | ## How to use 30 | ```objc 31 | 提供两种使用方式: 32 | 1、继承UIViewController,自定义TableView。 33 | 使用方法很简单 34 | #import "XHPullRefreshTableViewController.h" 35 | 36 | 继承XHPullRefreshTableViewController, 37 | 38 | 提供以下多个方法处理加载数据的不同处理方法: 39 | /** 40 | * 是否支持下拉刷新 41 | */ 42 | @property (nonatomic, assign) BOOL pullDownRefreshed; 43 | 44 | /** 45 | * 是否支持上拉刷新 46 | */ 47 | @property (nonatomic, assign) BOOL loadMoreRefreshed; 48 | 49 | /** 50 | * 下拉刷新的样式 51 | */ 52 | @property (nonatomic, assign) XHPullDownRefreshViewType refreshViewType; 53 | 54 | /** 55 | * 加载数据的页码 56 | */ 57 | @property (nonatomic, assign) NSInteger requestCurrentPage; 58 | 59 | /** 60 | * 自动下拉刷新调用的方法,必须放在viewDidAppear方法内,别把这行代码放到别处,然后导致了错误,那就不好了嘛! 61 | */ 62 | - (void)startPullDownRefreshing; 63 | 64 | /** 65 | * 当下拉加载数据完成后,你必须调用该方法哦! 66 | */ 67 | - (void)endPullDownRefreshing; 68 | 69 | /** 70 | * 当上啦加载数据完成后,你也得调用该方法哦!然后你可能会问,那我要怎么判断是下拉还是上啦啊?requestCurrentPage看这个变量,会跟着变化哦! 71 | */ 72 | - (void)endLoadMoreRefreshing; 73 | 74 | /** 75 | * 当上啦加载数据回调告诉我们,已经没有下一页了,那你可以调用该方法,告诉用户你已经没有数据了哦! 76 | * 77 | * @param message 提示用户的信息 78 | */ 79 | - (void)endMoreOverWithMessage:(NSString *)message; 80 | 81 | /** 82 | * 当网络加载失败的时候,你必须调用该方法,如果你不调用,我也帮不了你了 83 | */ 84 | - (void)handleLoadMoreError; 85 | 86 | 87 | 2、直接使用UITableViewController,提供兼容下拉、上啦刷新的处理。 88 | #import "XHSysatemRefreshTableViewController.h" 89 | 90 | 提供的内部方法和第一个方式是一样的! 91 | 92 | 93 | 你也可以自己定制一个属于你自己的控制器,至于你要加入其他基础类的方法,那就您好好定制了。以下提供这些方法给您定制下拉、上拉的样式。 94 | #import "XHRefreshControl.h" 95 | 96 | XHRefreshControl *refreshControl = [[XHRefreshControl alloc] initWithScrollView:self.yourTableView delegate:self]; 97 | 98 | 以下手动可调用的方法 99 | /** 100 | * 外部手动启动下拉加载的方法,这个方法不需要手动去拖动UIScrollView 101 | */ 102 | - (void)startPullDownRefreshing; 103 | 104 | /** 105 | * 停止下拉刷新的方法 106 | */ 107 | - (void)endPullDownRefreshing; 108 | 109 | /** 110 | * 停止上提加载更多的方法 111 | */ 112 | - (void)endLoadMoreRefresing; 113 | 114 | /** 115 | * 没有更多的数据加载 116 | */ 117 | - (void)endMoreOverWithMessage:(NSString *)message; 118 | 119 | 120 | 121 | 以下是delegate方法,用于外部定制 122 | implementation XHRefreshControl required delegate: 123 | 124 | @required 125 | /** 126 | * 1、将要开始下拉刷新的方法 127 | */ 128 | - (void)beginPullDownRefreshing; 129 | 130 | /** 131 | * 2、将要开始上提加载更多的方法 132 | */ 133 | - (void)beginLoadMoreRefreshing; 134 | 135 | /** 136 | * 3、最后更新数据的时间 137 | * 138 | * @return 返回缓存最后更新某个页面的时间 139 | */ 140 | - (NSDate *)lastUpdateTime; 141 | 142 | @optional 143 | /** 144 | * 1、是否支持下拉刷新 145 | * 146 | * @return 如果没有实现该delegate方法,默认是支持下拉的,为YES 147 | */ 148 | - (BOOL)isPullDownRefreshed; 149 | 150 | /** 151 | * 2、是否支持上提加载更多 152 | * 153 | * @return 如果没有实现该delegate方法,默认是支持上提加载更多的,为YES 154 | */ 155 | - (BOOL)isLoadMoreRefreshed; 156 | 157 | /** 158 | * 3、标识下拉刷新是UIScrollView的子view,还是UIScrollView父view的子view 159 | * 160 | * @return 如果没有实现该delegate方法,默认是scrollView的子View,为XHRefreshViewLayerTypeOnScrollViews 161 | */ 162 | - (XHRefreshViewLayerType)refreshViewLayerType; 163 | 164 | /** 165 | * 4、下拉刷新使用哪种样式 166 | * 167 | * @return 如果没有实现该delegate方法,默认是网易新闻App的样式 168 | */ 169 | - (XHPullDownRefreshViewType)pullDownRefreshViewType; 170 | 171 | /** 172 | * 4、UIScrollView的控制器是否保留iOS7新的特性,意思是:tablView的内容是否可以穿透过导航条 173 | * 174 | * @return 如果不是先该delegate方法,默认是不支持的 175 | */ 176 | - (BOOL)keepiOS7NewApiCharacter; 177 | 178 | /** 179 | * 5、将自动加载更多的状态转换为手动加载需要的条件,现在是加载更多多少次后,开始转换 180 | * 181 | * @return 如果不实现该delegate方法,默认是5次 182 | */ 183 | - (NSInteger)autoLoadMoreRefreshedCountConverManual; 184 | 185 | /** 186 | * 6、获取用户定义下拉的View 187 | * 188 | * @return 返回用户定义的View 189 | */ 190 | - (UIView *)customPullDownRefreshView; 191 | 192 | /** 193 | * 7、通知外部,下拉的距离,用于定制某个时机的状态 194 | * 195 | * @param refreshView 需要改变状态的View 196 | * @param pullDownOffset 下拉的距离 197 | */ 198 | - (void)customPullDownRefreshView:(UIView *)customPullDownRefreshView withPullDownOffset:(CGFloat)pullDownOffset; 199 | 200 | /** 201 | * 8、将要下拉的时候,被调用 202 | * 203 | * @param customPullDownRefreshView 目标下拉的View 204 | */ 205 | - (void)customPullDownRefreshViewWillStartRefresh:(UIView *)customPullDownRefreshView; 206 | 207 | /** 208 | * 9、将要停止下啦的时候,被调用 209 | * 210 | * @param customPullDownRefreshView 目标下啦的View 211 | */ 212 | - (void)customPullDownRefreshViewWillEndRefresh:(UIView *)customPullDownRefreshView; 213 | 214 | 215 | 216 | 217 | ``` 218 | 219 | 220 | ## License 221 | 222 | 中文: XHRefreshControl 是在MIT协议下使用的,可以在LICENSE文件里面找到相关的使用协议信息。 223 | 224 | English: XHRefreshControl is available under the MIT license, see the LICENSE file for more information. 225 | 226 | 227 | 228 | ## 须知 Notes 229 | 如果您在您的项目中使用该开源组件,请给我们发[电子邮件](mailto:xhzengAIB@gmail.com?subject=From%20GitHub%20XHRefreshControl)告诉我们您的应用程序的名称,谢谢!主要是为了互推的效果,如果您的app火了,请给予少许的回报,如果您的App不火,或许能通过这个开源库了解到您的App! 230 | 231 | If you use this open source components in your project, please [Email us](mailto:xhzengAIB@gmail.com?subject=From%20GitHub%20XHRefreshControl) to notify us the name of your application(s). Thanks! 232 | 233 | -------------------------------------------------------------------------------- /RefreshControl/Assets/bicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhzengAIB/XHRefreshControl/8cb5e6a237fa57df6d675f1eeb969d51882df560/RefreshControl/Assets/bicon.png -------------------------------------------------------------------------------- /RefreshControl/Assets/bicon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhzengAIB/XHRefreshControl/8cb5e6a237fa57df6d675f1eeb969d51882df560/RefreshControl/Assets/bicon@2x.png -------------------------------------------------------------------------------- /RefreshControl/Assets/box@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhzengAIB/XHRefreshControl/8cb5e6a237fa57df6d675f1eeb969d51882df560/RefreshControl/Assets/box@2x.png -------------------------------------------------------------------------------- /RefreshControl/Assets/dark_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhzengAIB/XHRefreshControl/8cb5e6a237fa57df6d675f1eeb969d51882df560/RefreshControl/Assets/dark_circle.png -------------------------------------------------------------------------------- /RefreshControl/Assets/dark_circle@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhzengAIB/XHRefreshControl/8cb5e6a237fa57df6d675f1eeb969d51882df560/RefreshControl/Assets/dark_circle@2x.png -------------------------------------------------------------------------------- /RefreshControl/Assets/deliveryStaff0@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhzengAIB/XHRefreshControl/8cb5e6a237fa57df6d675f1eeb969d51882df560/RefreshControl/Assets/deliveryStaff0@2x.png -------------------------------------------------------------------------------- /RefreshControl/Assets/deliveryStaff1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhzengAIB/XHRefreshControl/8cb5e6a237fa57df6d675f1eeb969d51882df560/RefreshControl/Assets/deliveryStaff1@2x.png -------------------------------------------------------------------------------- /RefreshControl/Assets/deliveryStaff2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhzengAIB/XHRefreshControl/8cb5e6a237fa57df6d675f1eeb969d51882df560/RefreshControl/Assets/deliveryStaff2@2x.png -------------------------------------------------------------------------------- /RefreshControl/Assets/deliveryStaff3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhzengAIB/XHRefreshControl/8cb5e6a237fa57df6d675f1eeb969d51882df560/RefreshControl/Assets/deliveryStaff3@2x.png -------------------------------------------------------------------------------- /RefreshControl/Assets/light_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhzengAIB/XHRefreshControl/8cb5e6a237fa57df6d675f1eeb969d51882df560/RefreshControl/Assets/light_circle.png -------------------------------------------------------------------------------- /RefreshControl/Assets/light_circle@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhzengAIB/XHRefreshControl/8cb5e6a237fa57df6d675f1eeb969d51882df560/RefreshControl/Assets/light_circle@2x.png -------------------------------------------------------------------------------- /RefreshControl/Assets/staticDeliveryStaff@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhzengAIB/XHRefreshControl/8cb5e6a237fa57df6d675f1eeb969d51882df560/RefreshControl/Assets/staticDeliveryStaff@2x.png -------------------------------------------------------------------------------- /RefreshControl/Controllers/CustomTableViewController/XHBaseTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHBaseTableViewController.h 3 | // MessageDisplayExample 4 | // 5 | // Created by qtone-1 on 14-5-6. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XHBaseTableViewController : UIViewController 12 | 13 | /** 14 | * 显示大量数据的控件 15 | */ 16 | @property (nonatomic, strong) UITableView *tableView; 17 | /** 18 | * 初始化init的时候设置tableView的样式才有效 19 | */ 20 | @property (nonatomic, assign) UITableViewStyle tableViewStyle; 21 | 22 | /** 23 | * 大量数据的数据源 24 | */ 25 | @property (nonatomic, strong) NSMutableArray *dataSource; 26 | 27 | /** 28 | * 去除iOS7新的功能api,tableView的分割线变成iOS6正常的样式 29 | */ 30 | - (void)configuraTableViewNormalSeparatorInset; 31 | 32 | /** 33 | * 配置tableView右侧的index title 背景颜色,因为在iOS7有白色底色,iOS6没有 34 | * 35 | * @param tableView 目标tableView 36 | */ 37 | - (void)configuraSectionIndexBackgroundColorWithTableView:(UITableView *)tableView; 38 | 39 | /** 40 | * 加载本地或者网络数据源 41 | */ 42 | - (void)loadDataSource; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /RefreshControl/Controllers/CustomTableViewController/XHBaseTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHBaseTableViewController.m 3 | // MessageDisplayExample 4 | // 5 | // Created by qtone-1 on 14-5-6. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHBaseTableViewController.h" 10 | 11 | #import "XHFoundationCommon.h" 12 | 13 | @interface XHBaseTableViewController () 14 | 15 | /** 16 | * 判断tableView是否支持iOS7的api方法 17 | * 18 | * @return 返回预想结果 19 | */ 20 | - (BOOL)validateSeparatorInset; 21 | 22 | @end 23 | 24 | @implementation XHBaseTableViewController 25 | 26 | #pragma mark - Publish Method 27 | 28 | - (void)configuraTableViewNormalSeparatorInset { 29 | if ([self validateSeparatorInset]) { 30 | [_tableView setSeparatorInset:UIEdgeInsetsZero]; 31 | } 32 | } 33 | 34 | - (void)configuraSectionIndexBackgroundColorWithTableView:(UITableView *)tableView { 35 | if ([tableView respondsToSelector:@selector(setSectionIndexBackgroundColor:)]) { 36 | tableView.sectionIndexBackgroundColor = [UIColor clearColor]; 37 | } 38 | } 39 | 40 | - (void)loadDataSource { 41 | // subClasse 42 | } 43 | 44 | #pragma mark - Propertys 45 | 46 | - (UITableView *)tableView { 47 | if (!_tableView) { 48 | CGRect tableViewFrame = self.view.bounds; 49 | tableViewFrame.size.height -= (self.navigationController.viewControllers.count > 1 ? 0 : (CGRectGetHeight(self.tabBarController.tabBar.bounds))) + [XHFoundationCommon getAdapterHeight]; 50 | _tableView = [[UITableView alloc] initWithFrame:tableViewFrame style:self.tableViewStyle]; 51 | _tableView.delegate = self; 52 | _tableView.dataSource = self; 53 | 54 | _tableView.tableFooterView = [[UIView alloc] init]; 55 | if (![self validateSeparatorInset]) { 56 | if (self.tableViewStyle == UITableViewStyleGrouped) { 57 | UIView *backgroundView = [[UIView alloc] initWithFrame:_tableView.bounds]; 58 | backgroundView.backgroundColor = _tableView.backgroundColor; 59 | _tableView.backgroundView = backgroundView; 60 | } 61 | } 62 | 63 | if (self.tabBarController) { 64 | UIEdgeInsets scrollIndicatorInsets = _tableView.scrollIndicatorInsets; 65 | scrollIndicatorInsets.bottom -= CGRectGetHeight(self.tabBarController.tabBar.bounds); 66 | _tableView.scrollIndicatorInsets = scrollIndicatorInsets; 67 | } 68 | } 69 | return _tableView; 70 | } 71 | 72 | - (NSMutableArray *)dataSource { 73 | if (!_dataSource) { 74 | _dataSource = [[NSMutableArray alloc] initWithCapacity:1]; 75 | } 76 | return _dataSource; 77 | } 78 | 79 | #pragma mark - Life cycle 80 | 81 | - (void)viewDidLoad { 82 | [super viewDidLoad]; 83 | // Do any additional setup after loading the view. 84 | self.view.backgroundColor = [UIColor whiteColor]; 85 | [self.view addSubview:self.tableView]; 86 | } 87 | 88 | - (void)dealloc { 89 | self.dataSource = nil; 90 | _tableView.delegate = nil; 91 | _tableView.dataSource = nil; 92 | _tableView = nil; 93 | } 94 | 95 | - (void)didReceiveMemoryWarning { 96 | [super didReceiveMemoryWarning]; 97 | // Dispose of any resources that can be recreated. 98 | } 99 | 100 | #pragma mark - TableView Helper Method 101 | 102 | - (BOOL)validateSeparatorInset { 103 | if ([_tableView respondsToSelector:@selector(setSeparatorInset:)]) { 104 | return YES; 105 | } 106 | return NO; 107 | } 108 | 109 | #pragma mark - UITableView DataSource 110 | 111 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 112 | return 1; 113 | } 114 | 115 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 116 | return self.dataSource.count; 117 | } 118 | 119 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 120 | // in subClass 121 | return nil; 122 | } 123 | 124 | 125 | @end 126 | -------------------------------------------------------------------------------- /RefreshControl/Controllers/CustomTableViewController/XHFoundationCommon.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHFoundationCommon.h 3 | // MessageDisplayExample 4 | // 5 | // Created by qtone-1 on 14-4-28. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XHFoundationCommon : NSObject 12 | 13 | + (CGFloat)getAdapterHeight; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /RefreshControl/Controllers/CustomTableViewController/XHFoundationCommon.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHFoundationCommon.m 3 | // MessageDisplayExample 4 | // 5 | // Created by qtone-1 on 14-4-28. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHFoundationCommon.h" 10 | 11 | @implementation XHFoundationCommon 12 | 13 | + (CGFloat)getAdapterHeight { 14 | CGFloat adapterHeight = 0; 15 | if ([[[UIDevice currentDevice] systemVersion] integerValue] < 7.0) { 16 | adapterHeight = 44; 17 | } 18 | return adapterHeight; 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /RefreshControl/Controllers/CustomTableViewController/XHJDPullRefreshTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHJDPullRefreshTableViewController.h 3 | // XHRefreshControlExample 4 | // 5 | // Created by Jack_iMac on 15/4/22. 6 | // Copyright (c) 2015年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHPullRefreshTableViewController.h" 10 | 11 | @interface XHJDPullRefreshTableViewController : XHPullRefreshTableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /RefreshControl/Controllers/CustomTableViewController/XHJDPullRefreshTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHJDPullRefreshTableViewController.m 3 | // XHRefreshControlExample 4 | // 5 | // Created by Jack_iMac on 15/4/22. 6 | // Copyright (c) 2015年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHJDPullRefreshTableViewController.h" 10 | #import "XHJDRefreshView.h" 11 | 12 | @interface XHJDPullRefreshTableViewController () 13 | 14 | @property (nonatomic, strong) XHJDRefreshView *refreshView; 15 | 16 | @end 17 | 18 | @implementation XHJDPullRefreshTableViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | // Do any additional setup after loading the view. 23 | } 24 | 25 | - (void)didReceiveMemoryWarning { 26 | [super didReceiveMemoryWarning]; 27 | // Dispose of any resources that can be recreated. 28 | } 29 | 30 | #pragma mark - Propertys 31 | 32 | - (XHJDRefreshView *)refreshView { 33 | if (!_refreshView) { 34 | _refreshView = [[XHJDRefreshView alloc] initWithFrame:CGRectMake(0, -60, 320, 60)]; 35 | } 36 | return _refreshView; 37 | } 38 | 39 | #pragma mark - XHRefreshControl Delegate 40 | 41 | - (UIView *)customPullDownRefreshView { 42 | return self.refreshView; 43 | } 44 | 45 | - (void)customPullDownRefreshViewRefreshState:(XHRefreshState)refreshState { 46 | switch (refreshState) { 47 | case XHRefreshStateNormal: 48 | case XHRefreshStateStopped: 49 | [self.refreshView normal]; 50 | break; 51 | case XHRefreshStateLoading: 52 | [self.refreshView refreing]; 53 | break; 54 | case XHRefreshStatePulling: 55 | [self.refreshView willRefresh]; 56 | break; 57 | default: 58 | break; 59 | } 60 | } 61 | 62 | - (void)customPullDownRefreshView:(UIView *)customPullDownRefreshView withPullDownOffset:(CGFloat)pullDownOffset { 63 | self.refreshView.pullDownOffset = pullDownOffset; 64 | } 65 | 66 | - (void)customPullDownRefreshViewWillStartRefresh:(UIView *)customPullDownRefreshView { 67 | 68 | } 69 | - (void)customPullDownRefreshViewDidStartRefresh:(UIView *)customPullDownRefreshView { 70 | 71 | } 72 | 73 | - (void)customPullDownRefreshViewWillEndRefresh:(UIView *)customPullDownRefreshView { 74 | [self.refreshView endRefresing]; 75 | } 76 | - (void)customPullDownRefreshViewDidEndRefresh:(UIView *)customPullDownRefreshView { 77 | 78 | } 79 | 80 | - (XHPullDownRefreshViewType)pullDownRefreshViewType { 81 | return XHPullDownRefreshViewTypeCustom; 82 | } 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /RefreshControl/Controllers/CustomTableViewController/XHPinterestPullRefreshTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHPinterestPullRefreshTableViewController.h 3 | // XHRefreshControlExample 4 | // 5 | // Created by Jack_iMac on 15/8/7. 6 | // Copyright (c) 2015年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHPullRefreshTableViewController.h" 10 | 11 | @interface XHPinterestPullRefreshTableViewController : XHPullRefreshTableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /RefreshControl/Controllers/CustomTableViewController/XHPinterestPullRefreshTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHPinterestPullRefreshTableViewController.m 3 | // XHRefreshControlExample 4 | // 5 | // Created by Jack_iMac on 15/8/7. 6 | // Copyright (c) 2015年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHPinterestPullRefreshTableViewController.h" 10 | 11 | #import "XHPinterestRefreshView.h" 12 | 13 | @interface XHPinterestPullRefreshTableViewController () 14 | 15 | @property (nonatomic, strong) XHPinterestRefreshView *refreshView; 16 | 17 | @end 18 | 19 | @implementation XHPinterestPullRefreshTableViewController 20 | 21 | #pragma mark - Propertys 22 | 23 | - (XHPinterestRefreshView *)refreshView { 24 | if (!_refreshView) { 25 | _refreshView = [[XHPinterestRefreshView alloc] initWithFrame:CGRectMake(0, -50, CGRectGetWidth(self.view.bounds), 50)]; 26 | _refreshView.activityIndicatorColor = self.indicatorColor; 27 | } 28 | return _refreshView; 29 | } 30 | 31 | #pragma mark - XHRefreshControl Delegate 32 | 33 | - (UIView *)customPullDownRefreshView { 34 | return self.refreshView; 35 | } 36 | 37 | - (void)customPullDownRefreshViewRefreshState:(XHRefreshState)refreshState { 38 | switch (refreshState) { 39 | case XHRefreshStateNormal: 40 | case XHRefreshStateStopped: 41 | [self.refreshView normal]; 42 | break; 43 | case XHRefreshStateLoading: 44 | [self.refreshView refreing]; 45 | break; 46 | case XHRefreshStatePulling: 47 | break; 48 | default: 49 | break; 50 | } 51 | } 52 | 53 | - (void)customPullDownRefreshView:(UIView *)customPullDownRefreshView withPullDownOffset:(CGFloat)pullDownOffset { 54 | self.refreshView.pullDownOffset = pullDownOffset; 55 | } 56 | 57 | - (void)customPullDownRefreshViewWillStartRefresh:(UIView *)customPullDownRefreshView { 58 | [self.refreshView willStartRefreshing]; 59 | } 60 | - (void)customPullDownRefreshViewDidStartRefresh:(UIView *)customPullDownRefreshView { 61 | [self.refreshView didStartRefreshing]; 62 | } 63 | 64 | - (void)customPullDownRefreshViewWillEndRefresh:(UIView *)customPullDownRefreshView { 65 | [self.refreshView willEndRefreshing]; 66 | } 67 | - (void)customPullDownRefreshViewDidEndRefresh:(UIView *)customPullDownRefreshView { 68 | [self.refreshView didEndRefresing]; 69 | } 70 | 71 | - (XHPullDownRefreshViewType)pullDownRefreshViewType { 72 | return XHPullDownRefreshViewTypeCustom; 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /RefreshControl/Controllers/CustomTableViewController/XHPullRefreshTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHPullRefreshTableViewController.h 3 | // MessageDisplayExample 4 | // 5 | // Created by 曾 宪华 on 14-6-6. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHBaseTableViewController.h" 10 | 11 | #import "XHRefreshControl.h" 12 | 13 | @interface XHPullRefreshTableViewController : XHBaseTableViewController 14 | 15 | /** 16 | * 是否支持下拉刷新 17 | */ 18 | @property (nonatomic, assign) BOOL pullDownRefreshed; 19 | 20 | /** 21 | * 是否支持上拉刷新 22 | */ 23 | @property (nonatomic, assign) BOOL loadMoreRefreshed; 24 | 25 | /** 26 | * 下拉刷新的样式 27 | */ 28 | @property (nonatomic, assign) XHPullDownRefreshViewType refreshViewType; 29 | 30 | /** 31 | * 加载数据的页码 32 | */ 33 | @property (nonatomic, assign) NSInteger requestCurrentPage; 34 | 35 | /** 36 | * 是否显示下拉刷新的标签文本,如果返回YES,按照正常排版,如果返回NO,那转圈居中,默认是YES 37 | */ 38 | @property (nonatomic, assign) BOOL hasStatusLabelShowed; 39 | 40 | /** 41 | * 圆圈的颜色,默认是[UIColor colorWithRed:173 / 255.0 green:53 / 255.0 blue:60 / 255.0 alpha:1] 42 | */ 43 | @property (nonatomic, strong) UIColor *circleColor; 44 | 45 | /** 46 | * 圆圈的线条粗细,默认为1, 最大为2 47 | */ 48 | @property (nonatomic, assign) CGFloat circleLineWidth; 49 | 50 | /** 51 | * 菊花的颜色 52 | */ 53 | @property (nonatomic, strong) UIColor *indicatorColor; 54 | 55 | /** 56 | * 配置下拉、上拉加载组件 57 | */ 58 | - (void)setupRefreshControl; 59 | 60 | /** 61 | * 自动下拉刷新调用的方法,必须放在viewDidAppear方法内,别把这行代码放到别处,然后导致了错误,那就不好了嘛! 62 | */ 63 | - (void)startPullDownRefreshing; 64 | 65 | /** 66 | * 当下拉加载数据完成后,你必须调用该方法哦! 67 | */ 68 | - (void)endPullDownRefreshing; 69 | 70 | /** 71 | * 当上拉加载数据完成后,你也得调用该方法哦!然后你可能会问,那我要怎么判断是下拉还是上啦啊?requestCurrentPage看这个变量,会跟着变化哦! 72 | */ 73 | - (void)endLoadMoreRefreshing; 74 | 75 | /** 76 | * 当上拉加载数据回调告诉我们,已经没有下一页了,那你可以调用该方法,告诉用户你已经没有数据了哦! 77 | * 78 | * @param message 提示用户的信息 79 | */ 80 | - (void)endMoreOverWithMessage:(NSString *)message; 81 | 82 | /** 83 | * 当上拉加载数据回调告诉我们,已经没有下一页了,那你可以调用该方法,告诉用户你已经没有数据了哦! 84 | * 85 | * @param messageTipsView 提示用户的视图 86 | */ 87 | - (void)endMoreOverWithMessageTipsView:(UIView *)messageTipsView; 88 | 89 | /** 90 | * 重置是否有更多翻页数据要加载 91 | */ 92 | - (void)resetLoadMoreStatue:(BOOL)noMoreDataForLoaded; 93 | 94 | /** 95 | * 当网络加载失败的时候,你必须调用该方法,如果你不调用,我也帮不了你了 96 | */ 97 | - (void)handleLoadMoreError; 98 | 99 | /** 100 | * 获取当前是否在加载数据中 101 | * 102 | * @return 返回预期结果 103 | */ 104 | - (BOOL)isLoadingDataSource; 105 | 106 | @end 107 | -------------------------------------------------------------------------------- /RefreshControl/Controllers/CustomTableViewController/XHPullRefreshTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHPullRefreshTableViewController.m 3 | // MessageDisplayExample 4 | // 5 | // Created by 曾 宪华 on 14-6-6. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHPullRefreshTableViewController.h" 10 | 11 | @interface XHPullRefreshTableViewController () 12 | 13 | @property (nonatomic, strong) XHRefreshControl *refreshControl; 14 | 15 | @end 16 | 17 | @implementation XHPullRefreshTableViewController 18 | 19 | - (void)startPullDownRefreshing { 20 | [self.refreshControl startPullDownRefreshing]; 21 | } 22 | 23 | - (void)endPullDownRefreshing { 24 | [self.refreshControl endPullDownRefreshing]; 25 | } 26 | 27 | - (void)endLoadMoreRefreshing { 28 | [self.refreshControl endLoadMoreRefresing]; 29 | } 30 | 31 | - (void)endMoreOverWithMessage:(NSString *)message { 32 | [self.refreshControl endMoreOverWithMessage:message]; 33 | } 34 | 35 | - (void)endMoreOverWithMessageTipsView:(UIView *)messageTipsView { 36 | [self.refreshControl endMoreOverWithMessageTipsView:messageTipsView]; 37 | } 38 | 39 | - (void)resetLoadMoreStatue:(BOOL)noMoreDataForLoaded { 40 | [self.refreshControl resetLoadMoreStatue:noMoreDataForLoaded]; 41 | } 42 | 43 | - (void)handleLoadMoreError { 44 | [self.refreshControl handleLoadMoreError]; 45 | } 46 | 47 | - (BOOL)isLoadingDataSource { 48 | return [self.refreshControl isLoading]; 49 | } 50 | 51 | #pragma mark - Life Cycle 52 | 53 | - (void)setupRefreshControl { 54 | if (!_refreshControl) { 55 | _refreshControl = [[XHRefreshControl alloc] initWithScrollView:self.tableView delegate:self]; 56 | _refreshControl.hasStatusLabelShowed = self.hasStatusLabelShowed; 57 | _refreshControl.circleColor = self.circleColor; 58 | _refreshControl.circleLineWidth = self.circleLineWidth; 59 | _refreshControl.indicatorColor = self.indicatorColor; 60 | } 61 | } 62 | 63 | - (id)init { 64 | self = [super init]; 65 | if (self) { 66 | self.pullDownRefreshed = YES; 67 | self.loadMoreRefreshed = YES; 68 | self.circleColor = [UIColor colorWithRed:173 / 255.0 green:53 / 255.0 blue:60 / 255.0 alpha:1]; 69 | self.circleLineWidth = 1.0; 70 | self.indicatorColor = [UIColor colorWithRed:0.000 green:0.690 blue:0.209 alpha:1.000]; 71 | } 72 | return self; 73 | } 74 | 75 | - (void)viewDidAppear:(BOOL)animated { 76 | [super viewDidAppear:animated]; 77 | [self setupRefreshControl]; 78 | } 79 | 80 | - (void)viewDidLoad { 81 | [super viewDidLoad]; 82 | // Do any additional setup after loading the view. 83 | 84 | 85 | } 86 | 87 | - (void)didReceiveMemoryWarning { 88 | [super didReceiveMemoryWarning]; 89 | // Dispose of any resources that can be recreated. 90 | } 91 | 92 | #pragma mark - XHRefreshControl Delegate 93 | 94 | - (void)beginPullDownRefreshing { 95 | self.requestCurrentPage = 0; 96 | [self loadDataSource]; 97 | } 98 | 99 | - (void)beginLoadMoreRefreshing { 100 | self.requestCurrentPage ++; 101 | [self loadDataSource]; 102 | } 103 | 104 | - (NSString *)lastUpdateTimeString { 105 | 106 | NSString *destDateString; 107 | destDateString = @"从未更新"; 108 | 109 | return destDateString; 110 | } 111 | 112 | - (NSInteger)autoLoadMoreRefreshedCountConverManual { 113 | return 5; 114 | } 115 | 116 | - (BOOL)isPullDownRefreshed { 117 | return self.pullDownRefreshed; 118 | } 119 | 120 | - (BOOL)isLoadMoreRefreshed { 121 | return self.loadMoreRefreshed; 122 | } 123 | 124 | - (XHRefreshViewLayerType)refreshViewLayerType { 125 | return XHRefreshViewLayerTypeOnScrollViews; 126 | } 127 | 128 | - (XHPullDownRefreshViewType)pullDownRefreshViewType { 129 | return self.refreshViewType; 130 | } 131 | 132 | - (NSString *)displayAutoLoadMoreRefreshedMessage { 133 | return @"点击显示下10条"; 134 | } 135 | 136 | @end 137 | -------------------------------------------------------------------------------- /RefreshControl/Controllers/SystemCollectionViewController/XHSystemCollectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHSystemCollectionViewController.h 3 | // XHRefreshControlExample 4 | // 5 | // Created by Jiangliyin on 14-9-14. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface XHSystemCollectionViewController : UICollectionViewController 13 | 14 | /** 15 | * 大量数据的数据源 16 | */ 17 | @property (nonatomic, strong) NSMutableArray *dataSource; 18 | 19 | /** 20 | * 加载本地或者网络数据源 21 | */ 22 | - (void)loadDataSource; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /RefreshControl/Controllers/SystemCollectionViewController/XHSystemCollectionViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHSystemCollectionViewController.m 3 | // XHRefreshControlExample 4 | // 5 | // Created by Jiangliyin on 14-9-14. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHSystemCollectionViewController.h" 10 | 11 | @interface XHSystemCollectionViewController () 12 | 13 | 14 | @end 15 | 16 | @implementation XHSystemCollectionViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | self.collectionView.alwaysBounceVertical = YES; 21 | } 22 | 23 | #pragma mark - Publish Method 24 | 25 | - (void)loadDataSource { 26 | // in subClass 27 | } 28 | 29 | #pragma mark - UICollectionView DataSource 30 | 31 | - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView { 32 | return 1; 33 | } 34 | 35 | - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { 36 | return self.dataSource.count; 37 | } 38 | 39 | // The cell that is returned must be retrieved from a call to -dequeueReusableCellWithReuseIdentifier:forIndexPath: 40 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { 41 | // in subClass 42 | return nil; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /RefreshControl/Controllers/SystemCollectionViewController/XHSystemRefreshCollectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHSystemCollectionViewController.h 3 | // XHRefreshControlExample 4 | // 5 | // Created by Jiangliyin on 14-9-14. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHSystemCollectionViewController.h" 10 | 11 | #import "XHRefreshControl.h" 12 | 13 | @interface XHSystemRefreshCollectionViewController : XHSystemCollectionViewController 14 | 15 | /** 16 | * 是否支持下拉刷新 17 | */ 18 | @property (nonatomic, assign) BOOL pullDownRefreshed; 19 | 20 | /** 21 | * 是否支持上拉刷新 22 | */ 23 | @property (nonatomic, assign) BOOL loadMoreRefreshed; 24 | 25 | /** 26 | * 下拉刷新的样式 27 | */ 28 | @property (nonatomic, assign) XHPullDownRefreshViewType refreshViewType; 29 | 30 | /** 31 | * 加载数据的页码 32 | */ 33 | @property (nonatomic, assign) NSInteger requestCurrentPage; 34 | 35 | /** 36 | * 是否显示下拉刷新的标签文本,如果返回YES,按照正常排版,如果返回NO,那转圈居中,默认是YES 37 | */ 38 | @property (nonatomic, assign) BOOL hasStatusLabelShowed; 39 | 40 | /** 41 | * 圆圈的颜色,默认是[UIColor colorWithRed:173 / 255.0 green:53 / 255.0 blue:60 / 255.0 alpha:1] 42 | */ 43 | @property (nonatomic, strong) UIColor *circleColor; 44 | 45 | /** 46 | * 圆圈的线条粗细,默认为1, 最大为2 47 | */ 48 | @property (nonatomic, assign) CGFloat circleLineWidth; 49 | 50 | /** 51 | * 自动下拉刷新调用的方法,必须放在viewDidAppear方法内,别把这行代码放到别处,然后导致了错误,那就不好了嘛! 52 | */ 53 | - (void)startPullDownRefreshing; 54 | 55 | /** 56 | * 当下拉加载数据完成后,你必须调用该方法哦! 57 | */ 58 | - (void)endPullDownRefreshing; 59 | 60 | /** 61 | * 当上啦加载数据完成后,你也得调用该方法哦!然后你可能会问,那我要怎么判断是下拉还是上啦啊?requestCurrentPage看这个变量,会跟着变化哦! 62 | */ 63 | - (void)endLoadMoreRefreshing; 64 | 65 | /** 66 | * 当上啦加载数据回调告诉我们,已经没有下一页了,那你可以调用该方法,告诉用户你已经没有数据了哦! 67 | * 68 | * @param message 提示用户的信息 69 | */ 70 | - (void)endMoreOverWithMessage:(NSString *)message; 71 | 72 | /** 73 | * 当上拉加载数据回调告诉我们,已经没有下一页了,那你可以调用该方法,告诉用户你已经没有数据了哦! 74 | * 75 | * @param messageTipsView 提示用户的视图 76 | */ 77 | - (void)endMoreOverWithMessageTipsView:(UIView *)messageTipsView; 78 | 79 | /** 80 | * 重置是否有更多翻页数据要加载 81 | */ 82 | - (void)resetLoadMoreStatue:(BOOL)noMoreDataForLoaded; 83 | 84 | /** 85 | * 当网络加载失败的时候,你必须调用该方法,如果你不调用,我也帮不了你了 86 | */ 87 | - (void)handleLoadMoreError; 88 | 89 | /** 90 | * 获取当前是否在加载数据中 91 | * 92 | * @return 返回预期结果 93 | */ 94 | - (BOOL)isLoadingDataSource; 95 | 96 | @end 97 | -------------------------------------------------------------------------------- /RefreshControl/Controllers/SystemCollectionViewController/XHSystemRefreshCollectionViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHSystemCollectionViewController.m 3 | // XHRefreshControlExample 4 | // 5 | // Created by Jiangliyin on 14-9-14. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHSystemRefreshCollectionViewController.h" 10 | 11 | @interface XHSystemRefreshCollectionViewController () 12 | 13 | @property (nonatomic, strong) XHRefreshControl *customRefreshControl; 14 | 15 | @end 16 | 17 | @implementation XHSystemRefreshCollectionViewController 18 | 19 | - (void)startPullDownRefreshing { 20 | [self.customRefreshControl startPullDownRefreshing]; 21 | } 22 | 23 | - (void)endPullDownRefreshing { 24 | [self.customRefreshControl endPullDownRefreshing]; 25 | } 26 | 27 | - (void)endLoadMoreRefreshing { 28 | [self.customRefreshControl endLoadMoreRefresing]; 29 | } 30 | 31 | - (void)endMoreOverWithMessage:(NSString *)message { 32 | [self.customRefreshControl endMoreOverWithMessage:message]; 33 | } 34 | 35 | - (void)endMoreOverWithMessageTipsView:(UIView *)messageTipsView { 36 | [self.customRefreshControl endMoreOverWithMessageTipsView:messageTipsView]; 37 | } 38 | 39 | - (void)resetLoadMoreStatue:(BOOL)noMoreDataForLoaded { 40 | [self.customRefreshControl resetLoadMoreStatue:noMoreDataForLoaded]; 41 | } 42 | 43 | - (void)handleLoadMoreError { 44 | [self.customRefreshControl handleLoadMoreError]; 45 | } 46 | 47 | - (BOOL)isLoadingDataSource { 48 | return [self.customRefreshControl isLoading]; 49 | } 50 | 51 | #pragma mark - Life Cycle 52 | 53 | - (void)setupRefreshControl { 54 | if (!_customRefreshControl) { 55 | _customRefreshControl = [[XHRefreshControl alloc] initWithScrollView:self.collectionView delegate:self]; 56 | _customRefreshControl.hasStatusLabelShowed = self.hasStatusLabelShowed; 57 | _customRefreshControl.circleColor = self.circleColor; 58 | _customRefreshControl.circleLineWidth = self.circleLineWidth; 59 | } 60 | } 61 | 62 | - (id)init { 63 | self = [super init]; 64 | if (self) { 65 | self.pullDownRefreshed = YES; 66 | self.loadMoreRefreshed = YES; 67 | self.circleColor = [UIColor colorWithRed:173 / 255.0 green:53 / 255.0 blue:60 / 255.0 alpha:1]; 68 | self.circleLineWidth = 1.0; 69 | } 70 | return self; 71 | } 72 | 73 | - (void)viewDidAppear:(BOOL)animated { 74 | [super viewDidAppear:animated]; 75 | 76 | [self setupRefreshControl]; 77 | } 78 | 79 | - (void)viewDidLoad { 80 | [super viewDidLoad]; 81 | // Do any additional setup after loading the view. 82 | } 83 | 84 | - (void)didReceiveMemoryWarning { 85 | [super didReceiveMemoryWarning]; 86 | // Dispose of any resources that can be recreated. 87 | } 88 | 89 | - (void)dealloc { 90 | 91 | } 92 | 93 | #pragma mark - XHRefreshControl Delegate 94 | 95 | - (void)beginPullDownRefreshing { 96 | self.requestCurrentPage = 0; 97 | [self loadDataSource]; 98 | } 99 | 100 | - (void)beginLoadMoreRefreshing { 101 | self.requestCurrentPage ++; 102 | [self loadDataSource]; 103 | } 104 | 105 | - (NSDate *)lastUpdateTime { 106 | return [NSDate date]; 107 | } 108 | 109 | - (NSInteger)autoLoadMoreRefreshedCountConverManual { 110 | return 2; 111 | } 112 | 113 | - (BOOL)isPullDownRefreshed { 114 | return self.pullDownRefreshed; 115 | } 116 | 117 | - (BOOL)isLoadMoreRefreshed { 118 | return self.loadMoreRefreshed; 119 | } 120 | 121 | - (XHRefreshViewLayerType)refreshViewLayerType { 122 | return XHRefreshViewLayerTypeOnScrollViews; 123 | } 124 | 125 | - (XHPullDownRefreshViewType)pullDownRefreshViewType { 126 | return XHPullDownRefreshViewTypeActivityIndicator; 127 | } 128 | 129 | - (NSString *)displayAutoLoadMoreRefreshedMessage { 130 | return @"点击显示下10条"; 131 | } 132 | 133 | @end 134 | -------------------------------------------------------------------------------- /RefreshControl/Controllers/SystemTableViewController/XHSysatemRefreshTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHSysatemRefreshTableViewController.h 3 | // XHRefreshControlExample 4 | // 5 | // Created by dw_iOS on 14-6-17. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHSystemTableViewController.h" 10 | 11 | #import "XHRefreshControl.h" 12 | 13 | @interface XHSysatemRefreshTableViewController : XHSystemTableViewController 14 | 15 | /** 16 | * 是否支持下拉刷新 17 | */ 18 | @property (nonatomic, assign) BOOL pullDownRefreshed; 19 | 20 | /** 21 | * 是否支持上拉刷新 22 | */ 23 | @property (nonatomic, assign) BOOL loadMoreRefreshed; 24 | 25 | /** 26 | * 下拉刷新的样式 27 | */ 28 | @property (nonatomic, assign) XHPullDownRefreshViewType refreshViewType; 29 | 30 | /** 31 | * 加载数据的页码 32 | */ 33 | @property (nonatomic, assign) NSInteger requestCurrentPage; 34 | 35 | /** 36 | * 是否显示下拉刷新的标签文本,如果返回YES,按照正常排版,如果返回NO,那转圈居中,默认是YES 37 | */ 38 | @property (nonatomic, assign) BOOL hasStatusLabelShowed; 39 | 40 | /** 41 | * 圆圈的颜色,默认是[UIColor colorWithRed:173 / 255.0 green:53 / 255.0 blue:60 / 255.0 alpha:1] 42 | */ 43 | @property (nonatomic, strong) UIColor *circleColor; 44 | 45 | /** 46 | * 圆圈的线条粗细,默认为1, 最大为2 47 | */ 48 | @property (nonatomic, assign) CGFloat circleLineWidth; 49 | 50 | /** 51 | * 菊花的颜色 52 | */ 53 | @property (nonatomic, strong) UIColor *indicatorColor; 54 | 55 | /** 56 | * 自动下拉刷新调用的方法,必须放在viewDidAppear方法内,别把这行代码放到别处,然后导致了错误,那就不好了嘛! 57 | */ 58 | - (void)startPullDownRefreshing; 59 | 60 | /** 61 | * 当下拉加载数据完成后,你必须调用该方法哦! 62 | */ 63 | - (void)endPullDownRefreshing; 64 | 65 | /** 66 | * 当上啦加载数据完成后,你也得调用该方法哦!然后你可能会问,那我要怎么判断是下拉还是上啦啊?requestCurrentPage看这个变量,会跟着变化哦! 67 | */ 68 | - (void)endLoadMoreRefreshing; 69 | 70 | /** 71 | * 当上啦加载数据回调告诉我们,已经没有下一页了,那你可以调用该方法,告诉用户你已经没有数据了哦! 72 | * 73 | * @param message 提示用户的信息 74 | */ 75 | - (void)endMoreOverWithMessage:(NSString *)message; 76 | 77 | /** 78 | * 当上拉加载数据回调告诉我们,已经没有下一页了,那你可以调用该方法,告诉用户你已经没有数据了哦! 79 | * 80 | * @param messageTipsView 提示用户的视图 81 | */ 82 | - (void)endMoreOverWithMessageTipsView:(UIView *)messageTipsView; 83 | 84 | /** 85 | * 重置是否有更多翻页数据要加载 86 | */ 87 | - (void)resetLoadMoreStatue:(BOOL)noMoreDataForLoaded; 88 | 89 | /** 90 | * 当网络加载失败的时候,你必须调用该方法,如果你不调用,我也帮不了你了 91 | */ 92 | - (void)handleLoadMoreError; 93 | 94 | /** 95 | * 获取当前是否在加载数据中 96 | * 97 | * @return 返回预期结果 98 | */ 99 | - (BOOL)isLoadingDataSource; 100 | 101 | @end 102 | -------------------------------------------------------------------------------- /RefreshControl/Controllers/SystemTableViewController/XHSysatemRefreshTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHSysatemRefreshTableViewController.m 3 | // XHRefreshControlExample 4 | // 5 | // Created by dw_iOS on 14-6-17. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHSysatemRefreshTableViewController.h" 10 | 11 | @interface XHSysatemRefreshTableViewController () 12 | 13 | @property (nonatomic, strong) XHRefreshControl *customRefreshControl; 14 | 15 | @end 16 | 17 | @implementation XHSysatemRefreshTableViewController 18 | 19 | - (void)startPullDownRefreshing { 20 | [self.customRefreshControl startPullDownRefreshing]; 21 | } 22 | 23 | - (void)endPullDownRefreshing { 24 | [self.customRefreshControl endPullDownRefreshing]; 25 | } 26 | 27 | - (void)endLoadMoreRefreshing { 28 | [self.customRefreshControl endLoadMoreRefresing]; 29 | } 30 | 31 | - (void)endMoreOverWithMessage:(NSString *)message { 32 | [self.customRefreshControl endMoreOverWithMessage:message]; 33 | } 34 | 35 | - (void)endMoreOverWithMessageTipsView:(UIView *)messageTipsView { 36 | [self.customRefreshControl endMoreOverWithMessageTipsView:messageTipsView]; 37 | } 38 | 39 | /** 40 | * 重置是否有更多翻页数据要加载 41 | */ 42 | - (void)resetLoadMoreStatue:(BOOL)noMoreDataForLoaded { 43 | [self.customRefreshControl resetLoadMoreStatue:noMoreDataForLoaded]; 44 | } 45 | 46 | - (void)handleLoadMoreError { 47 | [self.customRefreshControl handleLoadMoreError]; 48 | } 49 | 50 | - (BOOL)isLoadingDataSource { 51 | return [self.customRefreshControl isLoading]; 52 | } 53 | 54 | #pragma mark - Life Cycle 55 | 56 | - (void)setupRefreshControl { 57 | if (!_customRefreshControl) { 58 | _customRefreshControl = [[XHRefreshControl alloc] initWithScrollView:self.tableView delegate:self]; 59 | _customRefreshControl.hasStatusLabelShowed = self.hasStatusLabelShowed; 60 | _customRefreshControl.circleColor = self.circleColor; 61 | _customRefreshControl.circleLineWidth = self.circleLineWidth; 62 | _customRefreshControl.indicatorColor = self.indicatorColor; 63 | } 64 | } 65 | 66 | - (id)init { 67 | self = [super init]; 68 | if (self) { 69 | self.pullDownRefreshed = YES; 70 | self.loadMoreRefreshed = YES; 71 | self.circleColor = [UIColor colorWithRed:173 / 255.0 green:53 / 255.0 blue:60 / 255.0 alpha:1]; 72 | self.circleLineWidth = 1.0; 73 | self.indicatorColor = [UIColor colorWithRed:0.000 green:0.690 blue:0.209 alpha:1.000]; 74 | } 75 | return self; 76 | } 77 | 78 | - (void)viewDidAppear:(BOOL)animated { 79 | [super viewDidAppear:animated]; 80 | 81 | [self setupRefreshControl]; 82 | } 83 | 84 | - (void)viewDidLoad { 85 | [super viewDidLoad]; 86 | // Do any additional setup after loading the view. 87 | } 88 | 89 | - (void)didReceiveMemoryWarning { 90 | [super didReceiveMemoryWarning]; 91 | // Dispose of any resources that can be recreated. 92 | } 93 | 94 | - (void)dealloc { 95 | 96 | } 97 | 98 | #pragma mark - XHRefreshControl Delegate 99 | 100 | - (void)beginPullDownRefreshing { 101 | self.requestCurrentPage = 0; 102 | [self loadDataSource]; 103 | } 104 | 105 | - (void)beginLoadMoreRefreshing { 106 | self.requestCurrentPage ++; 107 | [self loadDataSource]; 108 | } 109 | 110 | - (NSDate *)lastUpdateTime { 111 | return [NSDate date]; 112 | } 113 | 114 | - (NSInteger)autoLoadMoreRefreshedCountConverManual { 115 | return 2; 116 | } 117 | 118 | - (BOOL)isPullDownRefreshed { 119 | return self.pullDownRefreshed; 120 | } 121 | 122 | - (BOOL)isLoadMoreRefreshed { 123 | return self.loadMoreRefreshed; 124 | } 125 | 126 | - (XHRefreshViewLayerType)refreshViewLayerType { 127 | return XHRefreshViewLayerTypeOnScrollViews; 128 | } 129 | 130 | - (XHPullDownRefreshViewType)pullDownRefreshViewType { 131 | return XHPullDownRefreshViewTypeActivityIndicator; 132 | } 133 | 134 | - (NSString *)displayAutoLoadMoreRefreshedMessage { 135 | return @"点击显示下10条"; 136 | } 137 | 138 | @end 139 | -------------------------------------------------------------------------------- /RefreshControl/Controllers/SystemTableViewController/XHSystemTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHXHSystemTableViewController.h 3 | // XHRefreshControlExample 4 | // 5 | // Created by dw_iOS on 14-6-17. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface XHSystemTableViewController : UITableViewController 13 | 14 | /** 15 | * 大量数据的数据源 16 | */ 17 | @property (nonatomic, strong) NSMutableArray *dataSource; 18 | /** 19 | * 加载本地或者网络数据源 20 | */ 21 | - (void)loadDataSource; 22 | 23 | /** 24 | * 去除iOS7新的功能api,tableView的分割线变成iOS6正常的样式 25 | */ 26 | - (void)configuraTableViewNormalSeparatorInset; 27 | 28 | /** 29 | * 配置tableView右侧的index title 背景颜色,因为在iOS7有白色底色,iOS6没有 30 | * 31 | * @param tableView 目标tableView 32 | */ 33 | - (void)configuraSectionIndexBackgroundColorWithTableView:(UITableView *)tableView; 34 | 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /RefreshControl/Controllers/SystemTableViewController/XHSystemTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHSystemTableViewController.m 3 | // XHRefreshControlExample 4 | // 5 | // Created by dw_iOS on 14-6-17. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHSystemTableViewController.h" 10 | 11 | @interface XHSystemTableViewController () 12 | 13 | 14 | @end 15 | 16 | @implementation XHSystemTableViewController 17 | 18 | #pragma mark - Publish Method 19 | 20 | - (void)configuraTableViewNormalSeparatorInset { 21 | if ([self validateSeparatorInset]) { 22 | [self.tableView setSeparatorInset:UIEdgeInsetsZero]; 23 | } 24 | } 25 | 26 | - (void)configuraSectionIndexBackgroundColorWithTableView:(UITableView *)tableView { 27 | if ([tableView respondsToSelector:@selector(setSectionIndexBackgroundColor:)]) { 28 | tableView.sectionIndexBackgroundColor = [UIColor clearColor]; 29 | } 30 | } 31 | 32 | - (void)loadDataSource { 33 | // in subClass 34 | } 35 | 36 | #pragma mark - TableView Helper Method 37 | 38 | - (BOOL)validateSeparatorInset { 39 | if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) { 40 | return YES; 41 | } 42 | return NO; 43 | } 44 | 45 | #pragma mark - UITableView DataSource 46 | 47 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 48 | return 1; 49 | } 50 | 51 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 52 | return self.dataSource.count; 53 | } 54 | 55 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 56 | // in subClass 57 | return nil; 58 | } 59 | 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /RefreshControl/Manager/XHRefreshControl.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHRefreshControl.h 3 | // MessageDisplayExample 4 | // 5 | // Created by 曾 宪华 on 14-6-6. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "XHRefreshControlHeader.h" 12 | 13 | @protocol XHRefreshControlDelegate 14 | 15 | @required 16 | /** 17 | * 将要开始下拉刷新的方法 18 | */ 19 | - (void)beginPullDownRefreshing; 20 | 21 | /** 22 | * 将要开始上提加载更多的方法 23 | */ 24 | - (void)beginLoadMoreRefreshing; 25 | 26 | @optional 27 | /** 28 | * 比如有一些页面不需要下拉刷新,仅仅需要一次自动上拉加载更多,然后其他情况就归为手动滑动到底部是上拉加载更多,这个方法就会被调用,前提是需要调用一下startLoadMoreRefreshing 29 | */ 30 | - (void)startLoadMoreForAutoTrigger; 31 | 32 | /** 33 | * 是否支持下拉刷新 34 | * 35 | * @return 如果没有实现该delegate方法,默认是支持下拉的,为YES 36 | */ 37 | - (BOOL)isPullDownRefreshed; 38 | 39 | /** 40 | * 是否支持上提加载更多 41 | * 42 | * @return 如果没有实现该delegate方法,默认是支持上提加载更多的,为YES 43 | */ 44 | - (BOOL)isLoadMoreRefreshed; 45 | 46 | /** 47 | * 标识下拉刷新是UIScrollView的子view,还是UIScrollView父view的子view 48 | * 49 | * @return 如果没有实现该delegate方法,默认是scrollView的子View,为XHRefreshViewLayerTypeOnScrollViews 50 | */ 51 | - (XHRefreshViewLayerType)refreshViewLayerType; 52 | 53 | /** 54 | * 下拉刷新使用哪种样式 55 | * 56 | * @return 如果没有实现该delegate方法,默认是网易新闻App的样式 57 | */ 58 | - (XHPullDownRefreshViewType)pullDownRefreshViewType; 59 | 60 | /** 61 | * 将自动加载更多的状态转换为手动加载需要的条件,现在是加载更多多少次后,开始转换 62 | * 63 | * @return 如果不实现该delegate方法,默认是5次 64 | */ 65 | - (NSInteger)autoLoadMoreRefreshedCountConverManual; 66 | 67 | /** 68 | * 获取用户定义下拉的View 69 | * 70 | * @return 返回用户定义的View 71 | */ 72 | - (UIView *)customPullDownRefreshView; 73 | 74 | /** 75 | * 通知外部,下拉的距离,用于定制某个时机的状态 76 | * 77 | * @param refreshView 需要改变状态的View 78 | * @param pullDownOffset 下拉的距离 79 | */ 80 | - (void)customPullDownRefreshView:(UIView *)customPullDownRefreshView withPullDownOffset:(CGFloat)pullDownOffset; 81 | 82 | /** 83 | * 通知外部,下拉的状态,用于定制某个时机的状态 84 | * 85 | * @param refreshView 需要改变状态的View 86 | * @param refreshState 下拉的状态 87 | */ 88 | - (void)customPullDownRefreshViewRefreshState:(XHRefreshState)refreshState; 89 | 90 | /** 91 | * 将要下拉的时候,被调用 92 | * 93 | * @param customPullDownRefreshView 目标下拉的View 94 | */ 95 | - (void)customPullDownRefreshViewWillStartRefresh:(UIView *)customPullDownRefreshView; 96 | 97 | /** 98 | * 刚进入下拉的时候,被调用 99 | * 100 | * @param customPullDownRefreshView 目标下拉的View 101 | */ 102 | - (void)customPullDownRefreshViewDidStartRefresh:(UIView *)customPullDownRefreshView; 103 | 104 | /** 105 | * 将要停止下啦的时候,被调用 106 | * 107 | * @param customPullDownRefreshView 目标下啦的View 108 | */ 109 | - (void)customPullDownRefreshViewWillEndRefresh:(UIView *)customPullDownRefreshView; 110 | 111 | /** 112 | * 刚进入停止下啦的时候,被调用 113 | * 114 | * @param customPullDownRefreshView 目标下啦的View 115 | */ 116 | - (void)customPullDownRefreshViewDidEndRefresh:(UIView *)customPullDownRefreshView; 117 | 118 | /** 119 | * 加载更多的按钮,默认是网易新闻App的样式,如果你需要自己定制的话,可以,那你实现该Delegate方法 120 | */ 121 | - (UIButton *)customLoadMoreButton; 122 | 123 | /** 124 | * 最后更新数据的时间 125 | * 126 | * @return 返回缓存最后更新某个页面的时间 127 | */ 128 | - (NSString *)lastUpdateTimeString; 129 | 130 | /** 131 | * 用于显示手动上提加载更多的提示字眼 132 | * 133 | * @return 如果没有实现该Delegate,默认显示为显示下20条的字眼 134 | */ 135 | - (NSString *)displayAutoLoadMoreRefreshedMessage; 136 | 137 | /** 138 | * 当scrollView滚动到距离底部有多少距离 139 | * 140 | * @return 返回你预期想要的距离,默认是0,即是拖动scrollView到底部才开始加载 141 | */ 142 | - (CGFloat)preloadDistance; 143 | 144 | @end 145 | 146 | @interface XHRefreshControl : NSObject 147 | 148 | /** 149 | * 是否显示下拉刷新的标签文本,如果返回YES,按照正常排版,如果返回NO,那转圈居中,默认是YES 150 | */ 151 | @property (nonatomic, assign) BOOL hasStatusLabelShowed; 152 | 153 | /** 154 | * 圆圈的颜色,默认是[UIColor colorWithRed:173 / 255.0 green:53 / 255.0 blue:60 / 255.0 alpha:1] 155 | */ 156 | @property (nonatomic, strong) UIColor *circleColor; 157 | 158 | /** 159 | * 圆圈的线条粗细,默认为1, 最大为2 160 | */ 161 | @property (nonatomic, assign) CGFloat circleLineWidth; 162 | 163 | /** 164 | * 菊花的颜色 165 | */ 166 | @property (nonatomic, strong) UIColor *indicatorColor; 167 | 168 | - (id)initWithScrollView:(UIScrollView *)scrollView delegate:(id )delegate; 169 | 170 | /** 171 | * 外部手动启动下拉加载的方法,这个方法不需要手动去拖动UIScrollView 172 | */ 173 | - (void)startPullDownRefreshing; 174 | 175 | - (void)startControlPixelPullDownRefreshing; 176 | 177 | /** 178 | * 停止下拉刷新的方法 179 | */ 180 | - (void)endPullDownRefreshing; 181 | 182 | /** 183 | * 外部手动启动上拉加载更多的方法,这个方法不需要手动去拖动UIScrollView 184 | */ 185 | - (void)startLoadMoreRefreshing; 186 | 187 | /** 188 | * 停止上提加载更多的方法 189 | */ 190 | - (void)endLoadMoreRefresing; 191 | 192 | /** 193 | * 没有更多的数据加载,展示一个提示语 194 | */ 195 | - (void)endMoreOverWithMessage:(NSString *)message; 196 | 197 | /** 198 | * 没有更多的数据加载,展示一个提示视图 199 | */ 200 | - (void)endMoreOverWithMessageTipsView:(UIView *)messageTipsView; 201 | 202 | /** 203 | * 重置是否有更多翻页数据要加载 204 | */ 205 | - (void)resetLoadMoreStatue:(BOOL)noMoreDataForLoaded; 206 | 207 | /** 208 | * 当加载更多出现网络错误的时候 209 | */ 210 | - (void)handleLoadMoreError; 211 | 212 | /** 213 | * 获取是否下啦刷新中 214 | * 215 | * @return 返回预期结果 216 | */ 217 | - (BOOL)isLoading; 218 | 219 | 220 | @end 221 | -------------------------------------------------------------------------------- /RefreshControl/Manager/XHRefreshControlHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHRefreshControlHeader.h 3 | // XHRefreshControlExample 4 | // 5 | // Created by dw_iOS on 14-7-3. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #ifndef XHRefreshControlExample_XHRefreshControlHeader_h 10 | #define XHRefreshControlExample_XHRefreshControlHeader_h 11 | 12 | typedef NS_ENUM(NSInteger, XHRefreshViewLayerType) { 13 | XHRefreshViewLayerTypeOnSuperView = 0, 14 | XHRefreshViewLayerTypeOnScrollViews = 1, 15 | }; 16 | 17 | typedef NS_ENUM(NSInteger, XHPullDownRefreshViewType) { 18 | XHPullDownRefreshViewTypeCircle = 0, 19 | XHPullDownRefreshViewTypeActivityIndicator = 1, 20 | XHPullDownRefreshViewTypePinterest = 2, 21 | XHPullDownRefreshViewTypeCustom = 3, 22 | }; 23 | 24 | typedef NS_ENUM(NSInteger, XHRefreshState) { 25 | XHRefreshStatePulling = 0, 26 | XHRefreshStateNormal = 1, 27 | XHRefreshStateLoading = 2, 28 | XHRefreshStateStopped = 3, 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /RefreshControl/Views/XHActivityCircleIndicatorView.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHActivityCircleIndicatorView.h 3 | // XHRefreshControlExample 4 | // 5 | // Created by 曾 宪华 on 14-6-16. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "XHRefreshControlHeader.h" 12 | 13 | @interface XHActivityCircleIndicatorView : UIView 14 | 15 | /** 16 | * 菊花的颜色 17 | */ 18 | @property (nonatomic, copy) UIColor *tintColor; 19 | 20 | /** 21 | * 外部设置滑动距离 22 | */ 23 | @property (nonatomic, assign) CGFloat timeOffset; // 0.0 ~ 1.0 24 | 25 | /** 26 | * 标识下拉刷新是UIScrollView的子view,还是UIScrollView父view的子view, 默认是scrollView的子View,为XHRefreshViewLayerTypeOnScrollViews 27 | */ 28 | @property (nonatomic, assign) XHRefreshViewLayerType refreshViewLayerType; 29 | 30 | /** 31 | * 开始动画加载 32 | */ 33 | - (void)beginRefreshing; 34 | 35 | /** 36 | * 结束动画加载 37 | */ 38 | - (void)endRefreshing; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /RefreshControl/Views/XHActivityIndicatorView.h: -------------------------------------------------------------------------------- 1 | // 2 | // HZActivityIndicator.h 3 | // HZActivityIndicator 4 | // 5 | // Created by Hezi Cohen on 10/7/11. 6 | // Copyright (c) 2011 Hezi Cohen. All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions 10 | // are met: 11 | // 12 | // Redistributions of source code must retain the above copyright notice, 13 | // this list of conditions and the following disclaimer. 14 | // 15 | // Redistributions in binary form must reproduce the above copyright 16 | // notice, this list of conditions and the following disclaimer in the 17 | // documentation and/or other materials provided with the distribution. 18 | // 19 | // Neither the name of the project's author nor the names of its 20 | // contributors may be used to endorse or promote products derived from 21 | // this software without specific prior written permission. 22 | // 23 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 26 | // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 29 | // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 30 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 31 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 32 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | // 35 | 36 | #import 37 | 38 | // this code form https://github.com/hezi/HZActivityIndicatorView 39 | 40 | typedef enum HZActivityIndicatorDirection { 41 | HZActivityIndicatorDirectionClockwise = -1, 42 | HZActivityIndicatorDirectionCounterClockwise = 1 43 | } HZActivityIndicatorDirection; 44 | 45 | @interface XHActivityIndicatorView : UIView { 46 | NSUInteger _steps; 47 | CGFloat _stepDuration; 48 | BOOL _isAnimating; 49 | 50 | UIColor *_color; 51 | BOOL _hidesWhenStopped; 52 | UIRectCorner _roundedCoreners; 53 | CGSize _cornerRadii; 54 | CGSize _finSize; 55 | HZActivityIndicatorDirection _direction; 56 | UIActivityIndicatorViewStyle _actualActivityIndicatorViewStyle; 57 | } 58 | 59 | @property (nonatomic) NSUInteger steps; 60 | @property (nonatomic) NSUInteger indicatorRadius; 61 | @property (nonatomic) CGFloat stepDuration; 62 | @property (nonatomic) CGSize finSize; 63 | @property (nonatomic, strong) UIColor *color; 64 | @property (nonatomic) UIRectCorner roundedCoreners; 65 | @property (nonatomic) CGSize cornerRadii; 66 | @property (nonatomic) HZActivityIndicatorDirection direction; 67 | @property (nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle; 68 | @property (nonatomic) CGFloat progress; 69 | 70 | @property(nonatomic) BOOL hidesWhenStopped; 71 | 72 | - (id)initWithActivityIndicatorStyle:(UIActivityIndicatorViewStyle)style; 73 | 74 | - (void)startAnimating; 75 | - (void)stopAnimating; 76 | - (BOOL)isAnimating; 77 | 78 | - (UIBezierPath *)finPathWithRect:(CGRect)rect; 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /RefreshControl/Views/XHCircleView.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHCircleView.h 3 | // MessageDisplayExample 4 | // 5 | // Created by 曾 宪华 on 14-6-6. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "XHRefreshControlHeader.h" 12 | 13 | // 开始画圆圈时的offset 14 | #define kXHRefreshCircleViewHeight 20 15 | 16 | @interface XHCircleView : UIView 17 | 18 | /** 19 | * 圆圈开始旋转时的offset (即开始刷新数据时) 20 | */ 21 | @property (nonatomic, assign) CGFloat heightBeginToRefresh; 22 | 23 | /** 24 | * offset的Y值 25 | */ 26 | @property (nonatomic, assign) CGFloat offsetY; 27 | 28 | /** 29 | * 标识下拉刷新是UIScrollView的子view,还是UIScrollView父view的子view, 默认是scrollView的子View,为XHRefreshViewLayerTypeOnScrollViews 30 | */ 31 | @property (nonatomic, assign) XHRefreshViewLayerType refreshViewLayerType; 32 | 33 | /** 34 | * 圆圈的颜色,默认是[UIColor colorWithRed:173 / 255.0 green:53 / 255.0 blue:60 / 255.0 alpha:1] 35 | */ 36 | @property (nonatomic, strong) UIColor *circleColor; 37 | 38 | /** 39 | * 圆圈的线条粗细 40 | */ 41 | @property (nonatomic, assign) CGFloat circleLineWidth; 42 | 43 | /** 44 | * 旋转的animation 45 | * 46 | * @return animation 47 | */ 48 | + (CABasicAnimation*)repeatRotateAnimation; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /RefreshControl/Views/XHCircleView.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHCircleView.m 3 | // MessageDisplayExample 4 | // 5 | // Created by 曾 宪华 on 14-6-6. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHCircleView.h" 10 | 11 | @implementation XHCircleView 12 | 13 | - (void)setOffsetY:(CGFloat)offsetY { 14 | _offsetY = offsetY; 15 | [self setNeedsDisplay]; 16 | } 17 | 18 | - (id)initWithFrame:(CGRect)frame { 19 | self = [super initWithFrame:frame]; 20 | if (self) { 21 | _heightBeginToRefresh = 40; 22 | _offsetY = 0; 23 | 24 | self.backgroundColor = [UIColor clearColor]; 25 | } 26 | return self; 27 | } 28 | 29 | + (CABasicAnimation*)repeatRotateAnimation { 30 | CABasicAnimation *rotateAni = [CABasicAnimation animationWithKeyPath: @"transform.rotation.z"]; 31 | rotateAni.duration = 0.25; 32 | rotateAni.cumulative = YES; 33 | rotateAni.removedOnCompletion = NO; 34 | rotateAni.fillMode = kCAFillModeForwards; 35 | rotateAni.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 36 | rotateAni.toValue = [NSNumber numberWithFloat:M_PI / 2]; 37 | rotateAni.repeatCount = MAXFLOAT; 38 | 39 | return rotateAni; 40 | } 41 | 42 | - (void)drawRect:(CGRect)rect { 43 | 44 | CGContextRef context = UIGraphicsGetCurrentContext(); 45 | 46 | CGContextSetStrokeColorWithColor(context, self.circleColor.CGColor); 47 | CGContextSetLineWidth(context, self.circleLineWidth); 48 | 49 | static CGFloat radius = 9; 50 | if (self.refreshViewLayerType) { 51 | static CGFloat startAngle = M_PI / 2; 52 | CGFloat endAngle = (ABS(_offsetY) / _heightBeginToRefresh) * (M_PI * 19 / 10) + startAngle; 53 | CGContextAddArc(context, CGRectGetWidth(self.frame) / 2, CGRectGetHeight(self.frame) / 2, radius, startAngle, endAngle, 0); 54 | } else { 55 | static CGFloat startAngle = 3 * M_PI / 2.0; 56 | CGFloat endAngle = (ABS(_offsetY) / _heightBeginToRefresh) * (M_PI * 19 / 10) + startAngle; 57 | CGContextAddArc(context, CGRectGetWidth(self.frame) / 2, CGRectGetHeight(self.frame) / 2, radius, startAngle, endAngle, 0); 58 | } 59 | CGContextDrawPath(context, kCGPathStroke); 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /RefreshControl/Views/XHCircularProgressView.h: -------------------------------------------------------------------------------- 1 | // 2 | // BMYCircularProgressView.h 3 | // BMYPullToRefreshDemo 4 | // 5 | // Created by Alberto De Bortoli on 15/05/2014. 6 | // Copyright (c) 2014 Beamly. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | // this code from https://github.com/beamly/BMYCircularProgressPullToRefresh 12 | 13 | @interface XHCircularProgressView : UIView 14 | 15 | @property (nonatomic, assign) CGFloat progress; 16 | 17 | - (id)initWithFrame:(CGRect)frame 18 | logo:(UIImage *)logoImage 19 | backCircleImage:(UIImage *)backCircleImage 20 | frontCircleImage:(UIImage *)frontCircleImage; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /RefreshControl/Views/XHCircularProgressView.m: -------------------------------------------------------------------------------- 1 | // 2 | // BMYCircularProgressView.m 3 | // BMYPullToRefreshDemo 4 | // 5 | // Created by Alberto De Bortoli on 15/05/2014. 6 | // Copyright (c) 2014 Beamly. All rights reserved. 7 | // 8 | 9 | #import "XHCircularProgressView.h" 10 | 11 | #import 12 | 13 | #define degToRad(angle) (angle) * (M_PI / 180.0) 14 | 15 | @interface XHCircularProgressView () 16 | 17 | @property (nonatomic, strong) CAShapeLayer *logoLayer; 18 | @property (nonatomic, strong) CAShapeLayer *backCircleLayer; 19 | @property (nonatomic, strong) CAShapeLayer *frontCircleLayer; 20 | @property (nonatomic, strong) CAShapeLayer *pieLayer; 21 | 22 | @end 23 | 24 | @implementation XHCircularProgressView 25 | 26 | - (id)initWithFrame:(CGRect)frame 27 | logo:(UIImage *)logoImage 28 | backCircleImage:(UIImage *)backCircleImage 29 | frontCircleImage:(UIImage *)frontCircleImage { 30 | self = [super initWithFrame:frame]; 31 | if (self) { 32 | _logoLayer = [CAShapeLayer layer]; 33 | _backCircleLayer = [CAShapeLayer layer]; 34 | _frontCircleLayer = [CAShapeLayer layer]; 35 | _pieLayer = [CAShapeLayer layer]; 36 | 37 | [self.layer addSublayer:_logoLayer]; 38 | [self.layer addSublayer:_backCircleLayer]; 39 | [self.layer addSublayer:_frontCircleLayer]; 40 | [self.layer addSublayer:_pieLayer]; 41 | 42 | _logoLayer.contents = (__bridge id)[logoImage CGImage]; 43 | _backCircleLayer.contents = (__bridge id)[backCircleImage CGImage]; 44 | _frontCircleLayer.contents = (__bridge id)[frontCircleImage CGImage]; 45 | _frontCircleLayer.mask = _pieLayer; 46 | _logoLayer.opacity = 0.0f; 47 | } 48 | return self; 49 | } 50 | 51 | - (void)layoutSubviews { 52 | [super layoutSubviews]; 53 | _logoLayer.frame = self.bounds; 54 | _backCircleLayer.frame = self.bounds; 55 | _frontCircleLayer.frame = self.bounds; 56 | _pieLayer.frame = self.bounds; 57 | } 58 | 59 | #pragma mark - BMYProgressViewProtocol 60 | 61 | - (void)setProgress:(CGFloat)progress { 62 | [CATransaction begin]; 63 | [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; 64 | 65 | [self updatePie:_pieLayer forAngle:progress * 360.0f]; 66 | _frontCircleLayer.mask = _pieLayer; 67 | _logoLayer.opacity = progress; 68 | 69 | [CATransaction commit]; 70 | } 71 | 72 | #pragma mark - Private Methods 73 | 74 | - (void)updatePie:(CAShapeLayer *)layer forAngle:(CGFloat)degrees { 75 | CGFloat angle = degToRad(-90); 76 | CGPoint center_ = CGPointMake(CGRectGetWidth(layer.frame)/2.0, CGRectGetWidth(layer.frame)/2.0); 77 | CGFloat radius = CGRectGetWidth(layer.frame)/2.0; 78 | 79 | UIBezierPath *piePath = [UIBezierPath bezierPath]; 80 | [piePath moveToPoint:center_]; 81 | [piePath addLineToPoint:CGPointMake(center_.x, center_.y - radius)]; 82 | [piePath addArcWithCenter:center_ radius:radius startAngle:angle endAngle:degToRad(degrees - 90.0f) clockwise:YES]; 83 | [piePath addLineToPoint:center_]; 84 | [piePath closePath]; 85 | 86 | layer.path = piePath.CGPath; 87 | } 88 | 89 | @end 90 | -------------------------------------------------------------------------------- /RefreshControl/Views/XHJDRefreshView.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHJDRefreshView.h 3 | // XHRefreshControlExample 4 | // 5 | // Created by Jack_iMac on 15/4/22. 6 | // Copyright (c) 2015年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XHJDRefreshView : UIView 12 | 13 | @property (nonatomic, assign) CGFloat pullDownOffset; 14 | 15 | - (void)willRefresh; 16 | 17 | - (void)refreing; 18 | 19 | - (void)endRefresing; 20 | 21 | - (void)normal; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /RefreshControl/Views/XHJDRefreshView.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHJDRefreshView.m 3 | // XHRefreshControlExample 4 | // 5 | // Created by Jack_iMac on 15/4/22. 6 | // Copyright (c) 2015年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHJDRefreshView.h" 10 | 11 | @interface XHJDRefreshView () 12 | 13 | @property (nonatomic, strong) UIImageView *peopleImageView; 14 | @property (nonatomic, strong) UIImageView *animationImageView; 15 | @property (nonatomic, strong) UIImageView *boxView; 16 | @property (nonatomic, strong) UILabel *tipsLabel; 17 | @property (nonatomic, strong) UILabel *stateLabel; 18 | 19 | @end 20 | 21 | @implementation XHJDRefreshView 22 | 23 | - (instancetype)initWithFrame:(CGRect)frame { 24 | self = [super initWithFrame:frame]; 25 | if (self) { 26 | [self addSubview:self.peopleImageView]; 27 | [self addSubview:self.animationImageView]; 28 | [self addSubview:self.boxView]; 29 | [self addSubview:self.tipsLabel]; 30 | [self addSubview:self.stateLabel]; 31 | } 32 | return self; 33 | } 34 | 35 | - (void)willRefresh { 36 | self.stateLabel.text = @"松手更新"; 37 | } 38 | 39 | - (void)normal { 40 | self.stateLabel.text = @"下拉刷新"; 41 | } 42 | 43 | - (void)endRefresing { 44 | self.animationImageView.hidden = YES; 45 | [self.animationImageView stopAnimating]; 46 | 47 | self.peopleImageView.hidden = NO; 48 | self.boxView.hidden = NO; 49 | 50 | CGFloat thum = 0; 51 | [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ 52 | CGAffineTransform scaleTransform = CGAffineTransformMakeScale(0.0, 0.0); 53 | CGAffineTransform transform = CGAffineTransformTranslate(scaleTransform, thum * 30, thum * -35); 54 | self.peopleImageView.transform = transform; 55 | self.boxView.transform = CGAffineTransformMakeTranslation(- thum * 52, -thum); 56 | } completion:^(BOOL finished) { 57 | 58 | }]; 59 | 60 | 61 | } 62 | 63 | - (void)refreing { 64 | self.stateLabel.text = @"更新中..."; 65 | self.peopleImageView.hidden = YES; 66 | self.boxView.hidden = YES; 67 | self.animationImageView.hidden = NO; 68 | [self.animationImageView startAnimating]; 69 | } 70 | 71 | #pragma mark - Propertys 72 | 73 | - (void)setPullDownOffset:(CGFloat)pullDownOffset { 74 | _pullDownOffset = pullDownOffset; 75 | CGFloat thum = pullDownOffset / 40.0; 76 | self.peopleImageView.transform = CGAffineTransformConcat(CGAffineTransformMakeTranslation(thum * 30, thum * -35), CGAffineTransformMakeScale(thum, thum)); 77 | self.boxView.transform = CGAffineTransformMakeTranslation(- thum * 52, thum); 78 | } 79 | 80 | - (UIImageView *)peopleImageView { 81 | if (!_peopleImageView) { 82 | _peopleImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"staticDeliveryStaff"]]; 83 | CGRect peopleImageViewFrame = _peopleImageView.frame; 84 | peopleImageViewFrame.origin = CGPointMake(30, 15); 85 | _peopleImageView.frame = peopleImageViewFrame; 86 | _peopleImageView.transform = CGAffineTransformMakeScale(0.0, 0.0); 87 | } 88 | return _peopleImageView; 89 | } 90 | 91 | - (UIImageView *)animationImageView { 92 | if (!_animationImageView) { 93 | _animationImageView = [[UIImageView alloc] initWithFrame:CGRectMake(62, -14, 49, 74)]; 94 | NSArray *images = @[[UIImage imageNamed:@"deliveryStaff0"], 95 | [UIImage imageNamed:@"deliveryStaff1"], 96 | [UIImage imageNamed:@"deliveryStaff2"], 97 | [UIImage imageNamed:@"deliveryStaff3"] 98 | ]; 99 | _animationImageView.animationImages = images; 100 | _animationImageView.hidden = YES; 101 | _animationImageView.animationDuration = 0.3; 102 | } 103 | return _animationImageView; 104 | } 105 | 106 | - (UIImageView *)boxView { 107 | if (!_boxView) { 108 | _boxView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"box"]]; 109 | CGRect boxViewFrame = _boxView.frame; 110 | boxViewFrame.origin = CGPointMake(150, 10); 111 | _boxView.frame = boxViewFrame; 112 | } 113 | return _boxView; 114 | } 115 | 116 | - (UILabel *)tipsLabel { 117 | if (!_tipsLabel) { 118 | _tipsLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMidX(self.bounds) - 30, 15, 80, 20)]; 119 | _tipsLabel.text = @"让购物更便捷"; 120 | _tipsLabel.textAlignment = NSTextAlignmentLeft; 121 | _tipsLabel.font = [UIFont systemFontOfSize:14]; 122 | _tipsLabel.textColor = [UIColor colorWithWhite:0.574 alpha:1.000]; 123 | } 124 | return _tipsLabel; 125 | } 126 | 127 | - (UILabel *)stateLabel { 128 | if (!_stateLabel) { 129 | _stateLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(_tipsLabel.frame), CGRectGetMaxY(_tipsLabel.frame), 80, 14)]; 130 | _stateLabel.textAlignment = NSTextAlignmentLeft; 131 | _stateLabel.font = [UIFont systemFontOfSize:12]; 132 | _stateLabel.textColor = [UIColor colorWithWhite:0.714 alpha:1.000]; 133 | } 134 | return _stateLabel; 135 | } 136 | 137 | @end 138 | -------------------------------------------------------------------------------- /RefreshControl/Views/XHLoadMoreView.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHLoadMoreView.h 3 | // MessageDisplayExample 4 | // 5 | // Created by 曾 宪华 on 14-6-6. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #define kXHLoadMoreViewHeight 50 12 | 13 | @interface XHLoadMoreView : UIView 14 | 15 | /** 16 | * 加载更多的按钮 17 | */ 18 | @property (nonatomic, strong) UIButton *loadMoreButton; 19 | 20 | @property (nonatomic, strong) UIColor *activityIndicatorColor; 21 | 22 | /** 23 | * 当外部需要自定义加载更多的按钮时,需要通过该方法进行覆盖原本的按钮 24 | * 25 | * @param customLoadMoreButton 目标自定义加载更多按钮 26 | */ 27 | - (void)setupCustomLoadMoreButton:(UIButton *)customLoadMoreButton; 28 | 29 | /** 30 | * 开始加载 31 | */ 32 | - (void)startLoading; 33 | 34 | /** 35 | * 结束加载 36 | */ 37 | - (void)endLoading; 38 | 39 | /** 40 | * 设置手动加载更多的UI 41 | */ 42 | - (void)configuraManualStateWithMessage:(NSString *)message; 43 | 44 | /** 45 | * 当外部加载更多数据的时候,发现没有数据了,可以进行设置一些提示字眼 46 | * 47 | * @param message 被显示的目标文本 48 | */ 49 | - (void)configuraNothingMoreWithMessage:(NSString *)message; 50 | 51 | /** 52 | * 当外部加载更多数据的时候,发现没有数据了,可以进行设置一些更有趣的视图 53 | * 54 | * @param messageView 被显示的目标视图 55 | */ 56 | - (void)configuraNothingMoreWithMessageView:(UIView *)messageView; 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /RefreshControl/Views/XHLoadMoreView.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHLoadMoreView.m 3 | // MessageDisplayExample 4 | // 5 | // Created by 曾 宪华 on 14-6-6. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHLoadMoreView.h" 10 | 11 | #import "XHActivityIndicatorView.h" 12 | 13 | @interface XHLoadMoreView () 14 | 15 | /** 16 | * 系统默认菊花控件 17 | */ 18 | @property (nonatomic, strong) XHActivityIndicatorView *activityIndicatorView; 19 | 20 | /** 21 | * 外部定制的提示视图,只有在没有数据的情况下才会出现的 22 | */ 23 | @property (nonatomic, strong) UIView *messageView; 24 | 25 | @end 26 | 27 | @implementation XHLoadMoreView 28 | 29 | - (void)setupNormalButton { 30 | self.loadMoreButton.userInteractionEnabled = NO; 31 | self.loadMoreButton.hidden = NO; 32 | [self hideMessageView]; 33 | } 34 | 35 | - (void)setupNoneDataStauts { 36 | self.loadMoreButton.hidden = YES; 37 | [self.activityIndicatorView stopAnimating]; 38 | } 39 | 40 | - (void)hideMessageView { 41 | if (_messageView) { 42 | _messageView.hidden = YES; 43 | } 44 | } 45 | 46 | - (void)startLoading { 47 | [self setupNormalButton]; 48 | [self.loadMoreButton setTitle:@"正在载入" forState:UIControlStateNormal]; 49 | [self.activityIndicatorView startAnimating]; 50 | } 51 | 52 | - (void)endLoading { 53 | [self setupNormalButton]; 54 | [self.loadMoreButton setTitle:@"加载更多" forState:UIControlStateNormal]; 55 | [self.activityIndicatorView stopAnimating]; 56 | } 57 | 58 | - (void)configuraManualStateWithMessage:(NSString *)message { 59 | self.loadMoreButton.userInteractionEnabled = YES; 60 | self.loadMoreButton.hidden = NO; 61 | [self hideMessageView]; 62 | [self.loadMoreButton setTitle:message forState:UIControlStateNormal]; 63 | } 64 | 65 | - (void)configuraNothingMoreWithMessage:(NSString *)message { 66 | [self setupNormalButton]; 67 | [self.loadMoreButton setTitle:message forState:UIControlStateNormal]; 68 | } 69 | 70 | - (void)configuraNothingMoreWithMessageView:(UIView *)messageView { 71 | if (_messageView == messageView) { 72 | _messageView.hidden = NO; 73 | return; 74 | } 75 | [self setupNoneDataStauts]; 76 | messageView.backgroundColor = self.loadMoreButton.backgroundColor; 77 | self.messageView = messageView; 78 | [self addSubview:self.messageView]; 79 | } 80 | 81 | - (void)setupCustomLoadMoreButton:(UIButton *)customLoadMoreButton { 82 | customLoadMoreButton.frame = self.loadMoreButton.frame; 83 | if (_loadMoreButton) { 84 | [_loadMoreButton removeFromSuperview]; 85 | _loadMoreButton = nil; 86 | } 87 | _loadMoreButton = customLoadMoreButton; 88 | [self insertSubview:_loadMoreButton atIndex:0]; 89 | } 90 | 91 | #pragma mark - Propertys 92 | 93 | - (UIButton *)loadMoreButton { 94 | if (!_loadMoreButton) { 95 | _loadMoreButton = [[UIButton alloc] initWithFrame:CGRectMake(10, 5, CGRectGetWidth(self.bounds) - 20, CGRectGetHeight(self.bounds) - 10)]; 96 | _loadMoreButton.titleLabel.font = [UIFont systemFontOfSize:16]; 97 | [_loadMoreButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 98 | [_loadMoreButton setBackgroundColor:[UIColor colorWithWhite:0.922 alpha:1.000]]; 99 | _loadMoreButton.hidden = YES; 100 | } 101 | return _loadMoreButton; 102 | } 103 | 104 | - (void)setActivityIndicatorColor:(UIColor *)activityIndicatorColor { 105 | _activityIndicatorColor = activityIndicatorColor; 106 | self.activityIndicatorView.color = activityIndicatorColor; 107 | } 108 | 109 | - (XHActivityIndicatorView *)activityIndicatorView { 110 | if (!_activityIndicatorView) { 111 | _activityIndicatorView = [[XHActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)]; 112 | _activityIndicatorView.color = [UIColor colorWithRed:228/255.0 green:27 / 255.0 blue:70/255.0 alpha:1.000]; 113 | _activityIndicatorView.indicatorRadius = 6; 114 | _activityIndicatorView.hidesWhenStopped = YES; 115 | _activityIndicatorView.center = CGPointMake(CGRectGetWidth(self.bounds) / 2.85, CGRectGetHeight(self.bounds) / 2.0); 116 | } 117 | return _activityIndicatorView; 118 | } 119 | 120 | #pragma mark - Life Cycle 121 | 122 | - (id)initWithFrame:(CGRect)frame { 123 | self = [super initWithFrame:frame]; 124 | if (self) { 125 | // Initialization code 126 | self.backgroundColor = [UIColor clearColor]; 127 | [self addSubview:self.loadMoreButton]; 128 | [self addSubview:self.activityIndicatorView]; 129 | } 130 | return self; 131 | } 132 | 133 | - (void)dealloc { 134 | _loadMoreButton = nil; 135 | _activityIndicatorView = nil; 136 | } 137 | 138 | @end 139 | -------------------------------------------------------------------------------- /RefreshControl/Views/XHPinterestRefreshView.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHPinterestRefreshView.h 3 | // XHRefreshControlExample 4 | // 5 | // Created by Jack_iMac on 15/8/7. 6 | // Copyright (c) 2015年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XHPinterestRefreshView : UIView 12 | 13 | @property (nonatomic, strong) UIColor *activityIndicatorColor; 14 | 15 | @property (nonatomic, assign) CGFloat pullDownOffset; 16 | 17 | - (instancetype)initWithFrame:(CGRect)frame 18 | logoImageName:(NSString *)logoImageName 19 | backCircleImageName:(NSString *)backCircleImageName 20 | frontCircleImage:(NSString *)frontCircleImage; 21 | 22 | - (void)willStartRefreshing; 23 | - (void)didStartRefreshing; 24 | 25 | - (void)refreing; 26 | 27 | - (void)willEndRefreshing; 28 | - (void)didEndRefresing; 29 | 30 | - (void)normal; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /RefreshControl/Views/XHPinterestRefreshView.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHPinterestRefreshView.m 3 | // XHRefreshControlExample 4 | // 5 | // Created by Jack_iMac on 15/8/7. 6 | // Copyright (c) 2015年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHPinterestRefreshView.h" 10 | 11 | #import "XHActivityIndicatorView.h" 12 | #import "XHCircularProgressView.h" 13 | 14 | @interface XHPinterestRefreshView () 15 | 16 | @property (nonatomic, strong) XHActivityIndicatorView *activityIndicatorView; 17 | @property (nonatomic, strong) XHCircularProgressView *circularProgressView; 18 | 19 | @property (nonatomic, copy) NSString *logoImageName; 20 | @property (nonatomic, copy) NSString *backCircleImageName; 21 | @property (nonatomic, copy) NSString *frontCircleImage; 22 | 23 | @end 24 | 25 | @implementation XHPinterestRefreshView 26 | 27 | - (instancetype)initWithFrame:(CGRect)frame { 28 | return [self initWithFrame:frame logoImageName:@"bicon" backCircleImageName:@"light_circle" frontCircleImage:@"dark_circle"]; 29 | } 30 | 31 | - (instancetype)initWithFrame:(CGRect)frame 32 | logoImageName:(NSString *)logoImageName 33 | backCircleImageName:(NSString *)backCircleImageName 34 | frontCircleImage:(NSString *)frontCircleImage { 35 | self = [super initWithFrame:frame]; 36 | if (self) { 37 | self.logoImageName = logoImageName; 38 | self.backCircleImageName = backCircleImageName; 39 | self.frontCircleImage = frontCircleImage; 40 | 41 | [self addSubview:self.activityIndicatorView]; 42 | [self addSubview:self.circularProgressView]; 43 | } 44 | return self; 45 | } 46 | 47 | - (void)willStartRefreshing { 48 | [UIView animateWithDuration:0.2 delay:0 options:UIViewAnimationOptionCurveEaseInOut|UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionBeginFromCurrentState animations:^{ 49 | self.circularProgressView.alpha = 0.0; 50 | self.activityIndicatorView.alpha = 1.0; 51 | } completion:^(BOOL finished) { 52 | }]; 53 | [self.activityIndicatorView startAnimating]; 54 | } 55 | - (void)didStartRefreshing { 56 | } 57 | 58 | - (void)normal { 59 | } 60 | - (void)refreing { 61 | } 62 | 63 | - (void)willEndRefreshing { 64 | [UIView animateWithDuration:0.2 delay:0 options:UIViewAnimationOptionCurveEaseInOut|UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionBeginFromCurrentState animations:^{ 65 | self.circularProgressView.alpha = 1.0; 66 | self.activityIndicatorView.alpha = 0.0; 67 | } completion:^(BOOL finished) { 68 | }]; 69 | [self.activityIndicatorView stopAnimating]; 70 | } 71 | - (void)didEndRefresing { 72 | } 73 | 74 | #pragma mark - Propertys 75 | 76 | - (void)setPullDownOffset:(CGFloat)pullDownOffset { 77 | if (_pullDownOffset == pullDownOffset) { 78 | return ; 79 | } 80 | _pullDownOffset = pullDownOffset; 81 | 82 | CGFloat progress = pullDownOffset / 40.0; 83 | self.circularProgressView.progress = progress; 84 | } 85 | 86 | - (void)setActivityIndicatorColor:(UIColor *)activityIndicatorColor { 87 | _activityIndicatorColor = activityIndicatorColor; 88 | self.activityIndicatorView.color = activityIndicatorColor; 89 | } 90 | 91 | - (XHActivityIndicatorView *)activityIndicatorView { 92 | if (!_activityIndicatorView) { 93 | _activityIndicatorView = [[XHActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)]; 94 | _activityIndicatorView.color = [UIColor colorWithRed:228/255.0 green:27 / 255.0 blue:70/255.0 alpha:1.000]; 95 | _activityIndicatorView.indicatorRadius = 6; 96 | _activityIndicatorView.center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); 97 | } 98 | return _activityIndicatorView; 99 | } 100 | 101 | - (XHCircularProgressView *)circularProgressView { 102 | if (!_circularProgressView) { 103 | UIImage *logoImage = [UIImage imageNamed:self.logoImageName]; 104 | UIImage *backCircleImage = [UIImage imageNamed:self.backCircleImageName]; 105 | UIImage *frontCircleImage = [UIImage imageNamed:self.frontCircleImage]; 106 | 107 | _circularProgressView = [[XHCircularProgressView alloc] initWithFrame:CGRectMake(0, 0, 25, 25) 108 | logo:logoImage 109 | backCircleImage:backCircleImage 110 | frontCircleImage:frontCircleImage]; 111 | 112 | _circularProgressView.center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); 113 | } 114 | return _circularProgressView; 115 | } 116 | 117 | @end 118 | -------------------------------------------------------------------------------- /RefreshControl/Views/XHRefreshActivityIndicatorContainerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHRefreshActivityIndicatorContainerView.h 3 | // XHRefreshControlExample 4 | // 5 | // Created by 曾 宪华 on 14-6-16. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "XHActivityCircleIndicatorView.h" 12 | 13 | #import "XHRefreshControlHeader.h" 14 | 15 | @interface XHRefreshActivityIndicatorContainerView : UIView 16 | 17 | /** 18 | * iOS7自定义菊花转圈控件 19 | */ 20 | @property (nonatomic, strong) XHActivityCircleIndicatorView *activityIndicatorView; 21 | 22 | /** 23 | * 标识下拉刷新是UIScrollView的子view,还是UIScrollView父view的子view, 默认是scrollView的子View,为XHRefreshViewLayerTypeOnScrollViews 24 | */ 25 | @property (nonatomic, assign) XHRefreshViewLayerType refreshViewLayerType; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /RefreshControl/Views/XHRefreshActivityIndicatorContainerView.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHRefreshActivityIndicatorContainerView.m 3 | // XHRefreshControlExample 4 | // 5 | // Created by 曾 宪华 on 14-6-16. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHRefreshActivityIndicatorContainerView.h" 10 | 11 | @interface XHRefreshActivityIndicatorContainerView () 12 | 13 | @end 14 | 15 | @implementation XHRefreshActivityIndicatorContainerView 16 | 17 | #pragma mark - Propertys 18 | 19 | - (void)setRefreshViewLayerType:(XHRefreshViewLayerType)refreshViewLayerType { 20 | _refreshViewLayerType = refreshViewLayerType; 21 | 22 | CGRect activityIndicatorViewFrame; 23 | switch (refreshViewLayerType) { 24 | case XHRefreshViewLayerTypeOnSuperView: 25 | activityIndicatorViewFrame = CGRectMake(CGRectGetWidth(self.bounds) / 2.0, CGRectGetHeight(self.bounds) * 0.4, 0, 0); 26 | break; 27 | case XHRefreshViewLayerTypeOnScrollViews: 28 | activityIndicatorViewFrame = CGRectMake(CGRectGetWidth(self.bounds) / 2.0, CGRectGetHeight(self.bounds) * 0.6, 0, 0); 29 | break; 30 | default: 31 | break; 32 | } 33 | self.activityIndicatorView.frame = activityIndicatorViewFrame; 34 | } 35 | 36 | - (XHActivityCircleIndicatorView *)activityIndicatorView { 37 | if (!_activityIndicatorView) { 38 | _activityIndicatorView = [[XHActivityCircleIndicatorView alloc] initWithFrame:CGRectMake(CGRectGetWidth(self.bounds) / 2.0, CGRectGetHeight(self.bounds) * 0.6, 0, 0)]; 39 | _activityIndicatorView.refreshViewLayerType = self.refreshViewLayerType; 40 | 41 | } 42 | return _activityIndicatorView; 43 | } 44 | 45 | #pragma mark - Life Cycle 46 | 47 | - (instancetype)initWithFrame:(CGRect)frame { 48 | self = [super initWithFrame:frame]; 49 | if (self) { 50 | // Initialization code 51 | } 52 | return self; 53 | } 54 | 55 | - (void)willMoveToSuperview:(UIView *)newSuperview { 56 | if (newSuperview) { 57 | [self addSubview:self.activityIndicatorView]; 58 | } 59 | } 60 | 61 | - (void)dealloc { 62 | _activityIndicatorView = nil; 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /RefreshControl/Views/XHRefreshCircleContainerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHRefreshView.h 3 | // MessageDisplayExample 4 | // 5 | // Created by 曾 宪华 on 14-6-6. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "XHCircleView.h" 12 | 13 | @interface XHRefreshCircleContainerView : UIView 14 | 15 | /** 16 | * 线条圆形的控件 17 | */ 18 | @property (nonatomic, strong) XHCircleView *circleView; 19 | 20 | /** 21 | * 提示下拉刷新状态的标签 22 | */ 23 | @property (nonatomic, strong) UILabel *stateLabel; 24 | 25 | /** 26 | * 提示最后更新时间的标签 27 | */ 28 | @property (nonatomic, strong) UILabel *timeLabel; 29 | 30 | /** 31 | * 是否显示下拉刷新的标签文本,如果返回YES,按照正常排版,如果返回NO,那转圈居中 32 | */ 33 | @property (nonatomic, assign) BOOL hasStatusLabelShowed; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /RefreshControl/Views/XHRefreshCircleContainerView.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHRefreshView.m 3 | // MessageDisplayExample 4 | // 5 | // Created by 曾 宪华 on 14-6-6. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHRefreshCircleContainerView.h" 10 | 11 | @interface XHRefreshCircleContainerView () 12 | 13 | @end 14 | 15 | @implementation XHRefreshCircleContainerView 16 | 17 | #pragma mark - Propertys 18 | 19 | - (void)setHasStatusLabelShowed:(BOOL)hasStatusLabelShowed { 20 | _hasStatusLabelShowed = hasStatusLabelShowed; 21 | 22 | if (hasStatusLabelShowed) { 23 | self.circleView.frame = CGRectMake((CGRectGetWidth(self.bounds) - kXHRefreshCircleViewHeight) / 2 - 40, (CGRectGetHeight(self.bounds) - kXHRefreshCircleViewHeight) / 2 - 5, kXHRefreshCircleViewHeight, kXHRefreshCircleViewHeight); 24 | } else { 25 | self.circleView.center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); 26 | } 27 | self.stateLabel.hidden = !hasStatusLabelShowed; 28 | self.timeLabel.hidden = !hasStatusLabelShowed; 29 | } 30 | 31 | - (XHCircleView *)circleView { 32 | if (!_circleView) { 33 | _circleView = [[XHCircleView alloc] initWithFrame:CGRectMake((CGRectGetWidth(self.bounds) - kXHRefreshCircleViewHeight) / 2 - 40, (CGRectGetHeight(self.bounds) - kXHRefreshCircleViewHeight) / 2 - 5, kXHRefreshCircleViewHeight, kXHRefreshCircleViewHeight)]; 34 | } 35 | return _circleView; 36 | } 37 | 38 | - (UILabel *)stateLabel { 39 | if (!_stateLabel) { 40 | _stateLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.circleView.frame) + 5, CGRectGetMinY(self.circleView.frame), 160, 14)]; 41 | _stateLabel.backgroundColor = [UIColor clearColor]; 42 | _stateLabel.font = [UIFont systemFontOfSize:14.f]; 43 | _stateLabel.textColor = [UIColor blackColor]; 44 | } 45 | return _stateLabel; 46 | } 47 | 48 | - (UILabel *)timeLabel { 49 | if (!_timeLabel) { 50 | CGRect timeLabelFrame = self.stateLabel.frame; 51 | timeLabelFrame.origin.y += CGRectGetHeight(timeLabelFrame) + 6; 52 | _timeLabel = [[UILabel alloc] initWithFrame:timeLabelFrame]; 53 | _timeLabel.backgroundColor = [UIColor clearColor]; 54 | _timeLabel.font = [UIFont systemFontOfSize:11.f]; 55 | _timeLabel.textColor = [UIColor colorWithWhite:0.659 alpha:1.000]; 56 | } 57 | return _timeLabel; 58 | } 59 | 60 | #pragma mark - Life Cycle 61 | 62 | - (id)initWithFrame:(CGRect)frame { 63 | self = [super initWithFrame:frame]; 64 | if (self) { 65 | // Initialization code 66 | self.backgroundColor = [UIColor whiteColor]; 67 | [self addSubview:self.circleView]; 68 | [self addSubview:self.stateLabel]; 69 | [self addSubview:self.timeLabel]; 70 | } 71 | return self; 72 | } 73 | 74 | - (void)dealloc { 75 | _circleView = nil; 76 | _stateLabel = nil; 77 | _timeLabel = nil; 78 | } 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /XHRefreshControl.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "XHRefreshControl" 3 | s.version = "4.5.4" 4 | s.summary = "XHRefreshControl 是一款高扩展性、低耦合度的下拉刷新、上提加载更多的组件。" 5 | s.homepage = "https://github.com/xhzengAIB/XHRefreshControl" 6 | s.license = "MIT" 7 | s.authors = { "xhzengAIB" => "xhzengAIB@gmail.com" } 8 | s.source = { :git => "https://github.com/xhzengAIB/XHRefreshControl.git", :tag => "v4.5.4" } 9 | s.frameworks = 'Foundation', 'CoreGraphics', 'UIKit' 10 | s.platform = :ios, '5.0' 11 | s.source_files = 'RefreshControl/**/**/*.{h,m}' 12 | s.requires_arc = true 13 | end 14 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample.xcodeproj/project.xcworkspace/xcshareddata/XHRefreshControlExample.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | F23646C3-332A-4C0D-9FF8-34A2AAC7F79F 9 | IDESourceControlProjectName 10 | XHRefreshControlExample 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | AE94791ACD45CA8923DDC1AA92F1358E8D97E19C 14 | https://github.com/xhzengAIB/XHRefreshControl.git 15 | 16 | IDESourceControlProjectPath 17 | XHRefreshControlExample/XHRefreshControlExample.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | AE94791ACD45CA8923DDC1AA92F1358E8D97E19C 21 | ../../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/xhzengAIB/XHRefreshControl.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | AE94791ACD45CA8923DDC1AA92F1358E8D97E19C 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | AE94791ACD45CA8923DDC1AA92F1358E8D97E19C 36 | IDESourceControlWCCName 37 | XHRefreshControl 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample.xcodeproj/xcshareddata/xcschemes/XHRefreshControlExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 67 | 68 | 78 | 80 | 86 | 87 | 88 | 89 | 90 | 91 | 97 | 99 | 105 | 106 | 107 | 108 | 110 | 111 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample.xcodeproj/xcuserdata/JackMacbook.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample.xcodeproj/xcuserdata/JackMacbook.xcuserdatad/xcschemes/XHRefreshControlExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample.xcodeproj/xcuserdata/JackMacbook.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | XHRefreshControlExample.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | AB0B344B19429D4700EC0072 16 | 17 | primary 18 | 19 | 20 | AB0B346F19429D4800EC0072 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // XHRefreshControlExample 4 | // 5 | // Created by 曾 宪华 on 14-6-7. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // XHRefreshControlExample 4 | // 5 | // Created by 曾 宪华 on 14-6-7. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | #import "XHRootTableViewController.h" 12 | 13 | @implementation AppDelegate 14 | 15 | - (void)setupBarStyle { 16 | [[UINavigationBar appearance] setBarStyle:UIBarStyleBlackTranslucent]; 17 | [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; 18 | [[UIBarButtonItem appearance] setTitleTextAttributes:@{ 19 | NSForegroundColorAttributeName: [UIColor whiteColor], 20 | NSFontAttributeName : [UIFont systemFontOfSize:14], 21 | } 22 | forState:UIControlStateNormal]; 23 | } 24 | 25 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 26 | { 27 | // Override point for customization after application launch. 28 | [self setupBarStyle]; 29 | 30 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 31 | // Override point for customization after application launch. 32 | self.window.backgroundColor = [UIColor whiteColor]; 33 | 34 | self.window.rootViewController = [[UINavigationController alloc]initWithRootViewController:[[XHRootTableViewController alloc] init]]; 35 | 36 | [self.window makeKeyAndVisible]; 37 | 38 | return YES; 39 | } 40 | 41 | - (void)applicationWillResignActive:(UIApplication *)application 42 | { 43 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 44 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 45 | } 46 | 47 | - (void)applicationDidEnterBackground:(UIApplication *)application 48 | { 49 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 50 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 51 | } 52 | 53 | - (void)applicationWillEnterForeground:(UIApplication *)application 54 | { 55 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 56 | } 57 | 58 | - (void)applicationDidBecomeActive:(UIApplication *)application 59 | { 60 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 61 | } 62 | 63 | - (void)applicationWillTerminate:(UIApplication *)application 64 | { 65 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 66 | } 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Controllers/CollectionViewController/CollectionViewFlowLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // CollectionViewFlowLayout.h 3 | // XHRefreshControlExample 4 | // 5 | // Created by dw_iOS on 14-10-16. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CollectionViewFlowLayout : UICollectionViewFlowLayout 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Controllers/CollectionViewController/CollectionViewFlowLayout.m: -------------------------------------------------------------------------------- 1 | // 2 | // CollectionViewFlowLayout.m 3 | // XHRefreshControlExample 4 | // 5 | // Created by dw_iOS on 14-10-16. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "CollectionViewFlowLayout.h" 10 | 11 | @implementation CollectionViewFlowLayout 12 | 13 | - (id)init { 14 | self = [super init]; 15 | if (self) { 16 | self.itemSize = CGSizeMake(150, 150); 17 | self.minimumLineSpacing = 5; 18 | } 19 | return self; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Controllers/CollectionViewController/DemoCollectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DemoCollectionViewController.h 3 | // XHRefreshControlExample 4 | // 5 | // Created by dw_iOS on 14-10-16. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHSystemRefreshCollectionViewController.h" 10 | 11 | @interface DemoCollectionViewController : XHSystemRefreshCollectionViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Controllers/CollectionViewController/DemoCollectionViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DemoCollectionViewController.m 3 | // XHRefreshControlExample 4 | // 5 | // Created by dw_iOS on 14-10-16. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "DemoCollectionViewController.h" 10 | 11 | @interface CollectionViewCell : UICollectionViewCell 12 | @property (nonatomic, strong) UIImageView *imageView; 13 | @property (nonatomic, strong) UILabel *label; 14 | @end 15 | 16 | @implementation CollectionViewCell 17 | 18 | - (UIImageView *)imageView { 19 | if (!_imageView) { 20 | _imageView = [[UIImageView alloc] initWithFrame:self.bounds]; 21 | _imageView.contentMode = UIViewContentModeScaleAspectFit; 22 | _imageView.image = [UIImage imageNamed:@"奥迪.jpg"]; 23 | } 24 | return _imageView; 25 | } 26 | 27 | - (UILabel *)label { 28 | if (!_label) { 29 | _label = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(self.bounds) - 30, CGRectGetWidth(self.bounds), 30)]; 30 | _label.textColor = [UIColor redColor]; 31 | _label.textAlignment = NSTextAlignmentCenter; 32 | } 33 | return _label; 34 | } 35 | 36 | - (id)initWithFrame:(CGRect)frame { 37 | self = [super initWithFrame:frame]; 38 | if (self) { 39 | [self.contentView addSubview:self.imageView]; 40 | [self.contentView addSubview:self.label]; 41 | } 42 | return self; 43 | } 44 | 45 | @end 46 | 47 | @interface DemoCollectionViewController () 48 | 49 | @property (nonatomic, strong) UIImageView *messageTipsView; 50 | 51 | @end 52 | 53 | @implementation DemoCollectionViewController 54 | 55 | - (void)loadDataSource { 56 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 57 | if (self.requestCurrentPage > 0) { 58 | 59 | [self.dataSource addObjectsFromArray:@[@"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @""]]; 60 | [self.collectionView reloadData]; 61 | [self endLoadMoreRefreshing]; 62 | 63 | if (self.requestCurrentPage == 5) { 64 | [self endMoreOverWithMessageTipsView:self.messageTipsView]; 65 | return ; 66 | } 67 | } else { 68 | self.dataSource = [@[@"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @""] mutableCopy]; 69 | [self.collectionView reloadData]; 70 | [self endPullDownRefreshing]; 71 | } 72 | }); 73 | } 74 | 75 | - (id)initWithCollectionViewLayout:(UICollectionViewLayout *)layout { 76 | self = [super initWithCollectionViewLayout:layout]; 77 | if (self) { 78 | self.pullDownRefreshed = YES; 79 | self.loadMoreRefreshed = YES; 80 | } 81 | return self; 82 | } 83 | 84 | - (void)viewDidAppear:(BOOL)animated { 85 | [super viewDidAppear:animated]; 86 | if (!self.dataSource.count) { 87 | [self startPullDownRefreshing]; 88 | } 89 | } 90 | 91 | - (void)viewDidLoad { 92 | [super viewDidLoad]; 93 | // Do any additional setup after loading the view. 94 | self.collectionView.backgroundColor = [UIColor colorWithRed:248/255.0 green:249/255.0 blue:251/255.0 alpha:1.0]; 95 | [self.collectionView registerClass:[CollectionViewCell class] forCellWithReuseIdentifier:@"CollectionViewCell"]; 96 | } 97 | 98 | - (void)didReceiveMemoryWarning { 99 | [super didReceiveMemoryWarning]; 100 | // Dispose of any resources that can be recreated. 101 | } 102 | 103 | #pragma mark - Propertys 104 | 105 | - (UIImageView *)messageTipsView { 106 | if (!_messageTipsView) { 107 | _messageTipsView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth([[UIScreen mainScreen] bounds]), 50)]; 108 | _messageTipsView.image = [UIImage imageNamed:@"nothing_more_tips"]; 109 | } 110 | return _messageTipsView; 111 | } 112 | 113 | #pragma mark - XHRefreshControl Delegate 114 | 115 | - (UIButton *)customLoadMoreButton { 116 | UIButton *_loadMoreButton = [[UIButton alloc] initWithFrame:CGRectMake(10, 5, CGRectGetWidth(self.view.bounds) - 20, CGRectGetHeight(self.view.bounds) - 10)]; 117 | [_loadMoreButton setTitle:@"加载更多" forState:UIControlStateNormal]; 118 | _loadMoreButton.titleLabel.font = [UIFont systemFontOfSize:16]; 119 | [_loadMoreButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 120 | [_loadMoreButton setBackgroundColor:[UIColor colorWithRed:248/255.0 green:249/255.0 blue:251/255.0 alpha:1.0]]; 121 | return _loadMoreButton; 122 | } 123 | 124 | #pragma mark - CollectionView Delegate 125 | 126 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { 127 | CollectionViewCell *collectionViewCell = [collectionView dequeueReusableCellWithReuseIdentifier:@"CollectionViewCell" forIndexPath:indexPath]; 128 | collectionViewCell.label.text = @"askldjlaksjdl"; 129 | 130 | return collectionViewCell; 131 | } 132 | 133 | @end 134 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Controllers/CollectionViewController/奥迪.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhzengAIB/XHRefreshControl/8cb5e6a237fa57df6d675f1eeb969d51882df560/XHRefreshControlExample/XHRefreshControlExample/Controllers/CollectionViewController/奥迪.jpg -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Controllers/CustomLoadMoreButtonDemoTableViewController/XHCustomLoadMoreButtonDemoTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHCustomLoadMoreButtonDemoTableViewController.h 3 | // XHRefreshControlExample 4 | // 5 | // Created by dw_iOS on 14-6-25. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHDemoTableViewController.h" 10 | 11 | @interface XHCustomLoadMoreButtonDemoTableViewController : XHDemoTableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Controllers/CustomLoadMoreButtonDemoTableViewController/XHCustomLoadMoreButtonDemoTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHCustomLoadMoreButtonDemoTableViewController.m 3 | // XHRefreshControlExample 4 | // 5 | // Created by dw_iOS on 14-6-25. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHCustomLoadMoreButtonDemoTableViewController.h" 10 | 11 | @implementation XHCustomLoadMoreButtonDemoTableViewController 12 | 13 | #pragma mark - XHRefreshControl Delegate 14 | 15 | - (UIButton *)customLoadMoreButton { 16 | UIButton *_loadMoreButton = [[UIButton alloc] initWithFrame:CGRectMake(10, 5, CGRectGetWidth(self.view.bounds) - 20, CGRectGetHeight(self.view.bounds) - 10)]; 17 | [_loadMoreButton setTitle:@"加载更多" forState:UIControlStateNormal]; 18 | _loadMoreButton.titleLabel.font = [UIFont systemFontOfSize:16]; 19 | [_loadMoreButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 20 | [_loadMoreButton setBackgroundColor:[UIColor colorWithWhite:0.922 alpha:1.000]]; 21 | [_loadMoreButton.layer setMasksToBounds:YES]; 22 | [_loadMoreButton.layer setCornerRadius:8.0]; //设置矩形四个圆角半径 23 | return _loadMoreButton; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Controllers/DemoSystemTableViewController/XHDemoSystemTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHDemoNormalTableViewController.h 3 | // XHRefreshControlExample 4 | // 5 | // Created by dw_iOS on 14-6-17. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHSysatemRefreshTableViewController.h" 10 | 11 | @interface XHDemoSystemTableViewController : XHSysatemRefreshTableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Controllers/DemoSystemTableViewController/XHDemoSystemTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHDemoNormalTableViewController.m 3 | // XHRefreshControlExample 4 | // 5 | // Created by dw_iOS on 14-6-17. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHDemoSystemTableViewController.h" 10 | 11 | @implementation XHDemoSystemTableViewController 12 | 13 | - (void)loadDataSource { 14 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 15 | NSMutableArray *dataSource = [[NSMutableArray alloc] initWithObjects:@"请问你现在在哪里啊?我在广州天河", @"点击我查看最新消息,里面有惊喜哦!", @"点击我查看最新消息,里面有惊喜哦!", @"点击我查看最新消息,里面有惊喜哦!", @"点进入聊天页面,这里有多种显示样式", @"点击我查看最新消息,里面有惊喜哦!", @"点击我查看最新消息,里面有惊喜哦!", @"点击我查看最新消息,里面有惊喜哦!", @"点击我查看最新消息,里面有惊喜哦!", @"点击我查看最新消息,里面有惊喜哦!", @"点进入聊天页面,这里有多种显示样式", @"点击我查看最新消息,里面有惊喜哦!", @"点击我查看最新消息,里面有惊喜哦!", @"点击我查看最新消息,里面有惊喜哦!", nil]; 16 | 17 | NSMutableArray *indexPaths; 18 | if (self.requestCurrentPage) { 19 | indexPaths = [[NSMutableArray alloc] initWithCapacity:dataSource.count]; 20 | [dataSource enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 21 | [indexPaths addObject:[NSIndexPath indexPathForRow:self.dataSource.count + idx inSection:0]]; 22 | }]; 23 | } 24 | dispatch_async(dispatch_get_main_queue(), ^{ 25 | if (self.requestCurrentPage) { 26 | if (self.requestCurrentPage == arc4random() % 10) { 27 | [self handleLoadMoreError]; 28 | } else { 29 | [self endLoadMoreRefreshing]; 30 | [self.dataSource addObjectsFromArray:dataSource]; 31 | [self.tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone]; 32 | 33 | } 34 | } else { 35 | [self endPullDownRefreshing]; 36 | self.dataSource = dataSource; 37 | [self.tableView reloadData]; 38 | 39 | } 40 | }); 41 | }); 42 | } 43 | 44 | - (void)viewDidAppear:(BOOL)animated { 45 | [super viewDidAppear:animated]; 46 | [self startPullDownRefreshing]; 47 | } 48 | 49 | - (void)viewDidLoad { 50 | [super viewDidLoad]; 51 | [self configuraTableViewNormalSeparatorInset]; 52 | } 53 | 54 | #pragma mark - UITableView DataSource 55 | 56 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 57 | static NSString *cellIdentifier = @"cellIdentifier"; 58 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 59 | if (!cell) { 60 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; 61 | } 62 | cell.textLabel.text = @"只是为了看看,我不动"; 63 | 64 | return cell; 65 | } 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Controllers/DemoTableViewController/XHDemoTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHDemoTableViewController.h 3 | // XHRefreshControlExample 4 | // 5 | // Created by 曾 宪华 on 14-6-8. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHPullRefreshTableViewController.h" 10 | 11 | @interface XHDemoTableViewController : XHPullRefreshTableViewController 12 | 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Controllers/JDRefreshDemoTableViewController/XHJDRefreshDemoTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHJDRefreshDemoTableViewController.h 3 | // XHRefreshControlExample 4 | // 5 | // Created by Jack_iMac on 15/4/22. 6 | // Copyright (c) 2015年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHJDPullRefreshTableViewController.h" 10 | 11 | @interface XHJDRefreshDemoTableViewController : XHJDPullRefreshTableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Controllers/JDRefreshDemoTableViewController/XHJDRefreshDemoTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHJDRefreshDemoTableViewController.m 3 | // XHRefreshControlExample 4 | // 5 | // Created by Jack_iMac on 15/4/22. 6 | // Copyright (c) 2015年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHJDRefreshDemoTableViewController.h" 10 | 11 | @interface XHJDRefreshDemoTableViewController () 12 | 13 | @end 14 | 15 | @implementation XHJDRefreshDemoTableViewController 16 | 17 | - (void)viewDidAppear:(BOOL)animated { 18 | [super viewDidAppear:animated]; 19 | [self startPullDownRefreshing]; 20 | } 21 | 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | // Do any additional setup after loading the view. 25 | } 26 | 27 | - (void)didReceiveMemoryWarning { 28 | [super didReceiveMemoryWarning]; 29 | // Dispose of any resources that can be recreated. 30 | } 31 | 32 | - (void)loadDataSource { 33 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 34 | NSMutableArray *dataSource = [[NSMutableArray alloc] init]; 35 | for (int i = 0; i < 100; i ++) { 36 | [dataSource addObject:@"请问你现在在哪里啊?我在广州天河"]; 37 | } 38 | 39 | NSMutableArray *indexPaths; 40 | if (self.requestCurrentPage) { 41 | indexPaths = [[NSMutableArray alloc] initWithCapacity:dataSource.count]; 42 | [dataSource enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 43 | [indexPaths addObject:[NSIndexPath indexPathForRow:self.dataSource.count + idx inSection:0]]; 44 | }]; 45 | } 46 | sleep(1); 47 | dispatch_async(dispatch_get_main_queue(), ^{ 48 | if (self.requestCurrentPage) { 49 | if (self.requestCurrentPage == arc4random() % 10) { 50 | [self endMoreOverWithMessage:@"段子已加载完"]; 51 | } else { 52 | 53 | [self.dataSource addObjectsFromArray:dataSource]; 54 | [self.tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone]; 55 | [self endLoadMoreRefreshing]; 56 | } 57 | } else { 58 | if (rand() % 3 > 1) { 59 | self.loadMoreRefreshed = NO; 60 | } 61 | 62 | self.dataSource = dataSource; 63 | [self.tableView reloadData]; 64 | [self endPullDownRefreshing]; 65 | } 66 | }); 67 | }); 68 | } 69 | 70 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 71 | static NSString *cellIdentifier = @"cellIdentifier"; 72 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 73 | if (!cell) { 74 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier]; 75 | cell.backgroundColor = [UIColor whiteColor]; 76 | cell.contentView.backgroundColor = [UIColor whiteColor]; 77 | cell.backgroundColor = [UIColor whiteColor]; 78 | cell.textLabel.font = [UIFont systemFontOfSize:15]; 79 | } 80 | if (indexPath.row < self.dataSource.count) { 81 | cell.textLabel.text = self.dataSource[indexPath.row]; 82 | } 83 | 84 | return cell; 85 | } 86 | 87 | @end 88 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Controllers/PinterestDemoRefreshTableViewController/PinterestDemoRefreshTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PinterestDemoRefreshTableViewController.h 3 | // XHRefreshControlExample 4 | // 5 | // Created by Jack_iMac on 15/8/7. 6 | // Copyright (c) 2015年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHPinterestPullRefreshTableViewController.h" 10 | 11 | @interface PinterestDemoRefreshTableViewController : XHPinterestPullRefreshTableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Controllers/PinterestDemoRefreshTableViewController/PinterestDemoRefreshTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // PinterestDemoRefreshTableViewController.m 3 | // XHRefreshControlExample 4 | // 5 | // Created by Jack_iMac on 15/8/7. 6 | // Copyright (c) 2015年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "PinterestDemoRefreshTableViewController.h" 10 | 11 | @implementation PinterestDemoRefreshTableViewController 12 | 13 | - (void)viewDidAppear:(BOOL)animated { 14 | [super viewDidAppear:animated]; 15 | [self startPullDownRefreshing]; 16 | } 17 | 18 | - (instancetype)init { 19 | self = [super init]; 20 | if (self) { 21 | //self.pullDownRefreshed = NO; 22 | self.indicatorColor = [UIColor greenColor]; 23 | } 24 | return self; 25 | } 26 | 27 | - (void)viewDidLoad { 28 | [super viewDidLoad]; 29 | // Do any additional setup after loading the view. 30 | } 31 | 32 | - (void)didReceiveMemoryWarning { 33 | [super didReceiveMemoryWarning]; 34 | // Dispose of any resources that can be recreated. 35 | } 36 | 37 | - (void)dealloc { 38 | 39 | } 40 | 41 | - (void)loadDataSource { 42 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 43 | NSMutableArray *dataSource = [[NSMutableArray alloc] init]; 44 | for (int i = 0; i < 100; i ++) { 45 | [dataSource addObject:@"请问你现在在哪里啊?我在广州天河"]; 46 | } 47 | 48 | NSMutableArray *indexPaths; 49 | if (self.requestCurrentPage) { 50 | indexPaths = [[NSMutableArray alloc] initWithCapacity:dataSource.count]; 51 | [dataSource enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 52 | [indexPaths addObject:[NSIndexPath indexPathForRow:self.dataSource.count + idx inSection:0]]; 53 | }]; 54 | } 55 | sleep(4); 56 | dispatch_async(dispatch_get_main_queue(), ^{ 57 | if (self.requestCurrentPage) { 58 | if (self.requestCurrentPage == arc4random() % 10) { 59 | [self endMoreOverWithMessage:@"段子已加载完"]; 60 | } else { 61 | 62 | [self.dataSource addObjectsFromArray:dataSource]; 63 | [self.tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone]; 64 | [self endLoadMoreRefreshing]; 65 | } 66 | } else { 67 | if (rand() % 3 > 1) { 68 | self.loadMoreRefreshed = NO; 69 | } 70 | 71 | self.dataSource = dataSource; 72 | [self.tableView reloadData]; 73 | [self endPullDownRefreshing]; 74 | } 75 | }); 76 | }); 77 | } 78 | 79 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 80 | static NSString *cellIdentifier = @"cellIdentifier"; 81 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 82 | if (!cell) { 83 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier]; 84 | cell.backgroundColor = [UIColor whiteColor]; 85 | cell.contentView.backgroundColor = [UIColor whiteColor]; 86 | cell.backgroundColor = [UIColor whiteColor]; 87 | cell.textLabel.font = [UIFont systemFontOfSize:15]; 88 | } 89 | if (indexPath.row < self.dataSource.count) { 90 | cell.textLabel.text = self.dataSource[indexPath.row]; 91 | } 92 | 93 | return cell; 94 | } 95 | 96 | @end 97 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Controllers/Root/XHRootTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHRootTableViewController.h 3 | // XHRefreshControlExample 4 | // 5 | // Created by 曾 宪华 on 14-6-8. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHBaseTableViewController.h" 10 | 11 | @interface XHRootTableViewController : XHBaseTableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Controllers/Root/XHRootTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHRootTableViewController.m 3 | // XHRefreshControlExample 4 | // 5 | // Created by 曾 宪华 on 14-6-8. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHRootTableViewController.h" 10 | 11 | #import "XHDemoTableViewController.h" 12 | 13 | #import "XHDemoSystemTableViewController.h" 14 | 15 | #import "XHCustomLoadMoreButtonDemoTableViewController.h" 16 | 17 | #import "DemoCollectionViewController.h" 18 | 19 | #import "XHSegueItem.h" 20 | 21 | #import "CollectionViewFlowLayout.h" 22 | 23 | @interface XHRootTableViewController () 24 | 25 | @end 26 | 27 | @implementation XHRootTableViewController 28 | 29 | - (void)viewDidLoad 30 | { 31 | [super viewDidLoad]; 32 | // Do any additional setup after loading the view. 33 | self.title = @"高级下拉组件"; 34 | 35 | [self.view addSubview:self.tableView]; 36 | 37 | self.dataSource = [[NSMutableArray alloc] initWithObjects: 38 | [XHSegueItem initSegueItemWithTitle:@"京东原版下拉刷新" onClasseName:@"XHJDRefreshDemoTableViewController"], 39 | 40 | [XHSegueItem initSegueItemWithTitle:@"Pinterest" onClasseName:@"PinterestDemoRefreshTableViewController"], 41 | 42 | [XHSegueItem initSegueItemWithTitle:@"网易新闻样式没有导航栏的" onClasseName:@"XHDemoTableViewController"], 43 | 44 | [XHSegueItem initSegueItemWithTitle:@"网易新闻样式有导航栏的" onClasseName:@"XHDemoTableViewController"], 45 | 46 | [XHSegueItem initSegueItemWithTitle:@"模仿网易新闻4.0网络差的情况" onClasseName:@"XHSimulationNetEaseNetworkErrorViewController"], 47 | 48 | [XHSegueItem initSegueItemWithTitle:@"iOS7的系统样式,自定义出来啦!" onClasseName:@"XHDemoTableViewController"], 49 | 50 | [XHSegueItem initSegueItemWithTitle:@"UITableViewController使用我的下拉组件" onClasseName:@"XHDemoSystemTableViewController"], 51 | 52 | [XHSegueItem initSegueItemWithTitle:@"用户高级自定义样式" onClasseName:@"XHDemoTableViewController"], 53 | 54 | [XHSegueItem initSegueItemWithTitle:@"自定义加载更多的按钮样式" onClasseName:@"XHCustomLoadMoreButtonDemoTableViewController"], 55 | 56 | [XHSegueItem initSegueItemWithTitle:@"CollectionViewController" onClasseName:@"DemoCollectionViewController"], 57 | 58 | [XHSegueItem initSegueItemWithTitle:@"下一阶段准备写yelp的下拉刷新" onClasseName:@""], 59 | nil]; 60 | } 61 | 62 | - (void)didReceiveMemoryWarning 63 | { 64 | [super didReceiveMemoryWarning]; 65 | // Dispose of any resources that can be recreated. 66 | } 67 | 68 | #pragma mark - UITableView DataSource 69 | 70 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 71 | static NSString *cellIdentifier = @"cellIdentifier"; 72 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 73 | if (!cell) { 74 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier]; 75 | cell.textLabel.font = [UIFont systemFontOfSize:15]; 76 | 77 | cell.detailTextLabel.font = [UIFont systemFontOfSize:12]; 78 | 79 | } 80 | if (indexPath.row < self.dataSource.count) { 81 | XHSegueItem *segueItem = self.dataSource[indexPath.row]; 82 | cell.textLabel.text = segueItem.title; 83 | } 84 | 85 | return cell; 86 | } 87 | 88 | #pragma mark - UITableView Delegate 89 | 90 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 91 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 92 | 93 | NSInteger row = indexPath.row; 94 | XHSegueItem *segueItem = self.dataSource[row]; 95 | 96 | UIViewController *viewController = nil; 97 | if (row == 9) { 98 | viewController = [[DemoCollectionViewController alloc] initWithCollectionViewLayout:[[CollectionViewFlowLayout alloc] init]]; 99 | } else { 100 | viewController = [[NSClassFromString(segueItem.className) alloc] init]; 101 | } 102 | 103 | viewController.title = segueItem.title; 104 | 105 | if (row == 2) { 106 | 107 | [self presentViewController:viewController animated:YES completion:NULL]; 108 | return; 109 | 110 | } else if (row == 4) { 111 | 112 | ((XHDemoTableViewController *)viewController).refreshViewType = XHPullDownRefreshViewTypeActivityIndicator; 113 | 114 | } else if (row == 6) { 115 | 116 | ((XHDemoTableViewController *)viewController).refreshViewType = XHPullDownRefreshViewTypeCustom; 117 | 118 | } 119 | 120 | if (viewController) { 121 | [self.navigationController pushViewController:viewController animated:YES]; 122 | } 123 | } 124 | 125 | @end 126 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Controllers/SegmentController/XHSegmentViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHSegmentViewController.h 3 | // XHRefreshControlExample 4 | // 5 | // Created by dw_iOS on 14-7-10. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XHSegmentViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Controllers/SegmentController/XHSegmentViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHSegmentViewController.m 3 | // XHRefreshControlExample 4 | // 5 | // Created by dw_iOS on 14-7-10. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHSegmentViewController.h" 10 | 11 | #import "XHDemoTableViewController.h" 12 | 13 | @interface XHSegmentViewController () 14 | 15 | @property (nonatomic, strong) UISegmentedControl *segmentedControl; 16 | 17 | @property (nonatomic, strong) NSMutableDictionary *viewControllers; 18 | 19 | @end 20 | 21 | @implementation XHSegmentViewController 22 | 23 | - (void)segmentedControlValueChanged:(UISegmentedControl *)segmentedControl { 24 | // UIViewController *viewController = [self.viewControllers objectForKey:[NSString stringWithFormat:@"%d", segmentedControl.selectedSegmentIndex]]; 25 | // if (!viewController) { 26 | // viewController = [self demoTableViewController]; 27 | // } 28 | // [UIView transitionFromView:self.view toView:viewController.view duration:0 options:UIViewAnimationOptionTransitionNone completion:^(BOOL finished) { 29 | // 30 | // }]; 31 | } 32 | 33 | #pragma mark - Propertys 34 | 35 | - (UISegmentedControl *)segmentedControl { 36 | if (!_segmentedControl) { 37 | _segmentedControl = [[UISegmentedControl alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), 44)]; 38 | [_segmentedControl insertSegmentWithTitle:@"News" atIndex:0 animated:NO]; 39 | [_segmentedControl insertSegmentWithTitle:@"Home" atIndex:1 animated:NO]; 40 | [_segmentedControl insertSegmentWithTitle:@"Helper" atIndex:2 animated:NO]; 41 | [_segmentedControl addTarget:self action:@selector(segmentedControlValueChanged:) forControlEvents:UIControlEventValueChanged]; 42 | [_segmentedControl setSelectedSegmentIndex:0]; 43 | } 44 | return _segmentedControl; 45 | } 46 | 47 | #pragma mark - Life Cycle 48 | 49 | - (void)viewDidLoad { 50 | [super viewDidLoad]; 51 | // Do any additional setup after loading the view. 52 | [self.view addSubview:self.segmentedControl]; 53 | } 54 | 55 | - (void)didReceiveMemoryWarning { 56 | [super didReceiveMemoryWarning]; 57 | // Dispose of any resources that can be recreated. 58 | } 59 | 60 | #pragma mark - Pull Down View Controller Helper Method 61 | 62 | - (XHDemoTableViewController *)demoTableViewController { 63 | XHDemoTableViewController *demoTableViewController = [[XHDemoTableViewController alloc] init]; 64 | return demoTableViewController; 65 | } 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Controllers/SimulationNetEaseNetworkErrorViewController/XHSimulationNetEaseNetworkErrorViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SimulationNetEaseNetworkErrorViewController.h 3 | // XHRefreshControlExample 4 | // 5 | // Created by 曾 宪华 on 15/1/6. 6 | // Copyright (c) 2015年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHDemoTableViewController.h" 10 | 11 | @interface XHSimulationNetEaseNetworkErrorViewController : XHDemoTableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Controllers/SimulationNetEaseNetworkErrorViewController/XHSimulationNetEaseNetworkErrorViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SimulationNetEaseNetworkErrorViewController.m 3 | // XHRefreshControlExample 4 | // 5 | // Created by 曾 宪华 on 15/1/6. 6 | // Copyright (c) 2015年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHSimulationNetEaseNetworkErrorViewController.h" 10 | 11 | @interface XHSimulationNetEaseNetworkErrorViewController () 12 | 13 | @property (nonatomic, assign) BOOL isFrist; 14 | 15 | @end 16 | 17 | @implementation XHSimulationNetEaseNetworkErrorViewController 18 | 19 | - (void)loadDataSource { 20 | NSMutableArray *dataSource = [[NSMutableArray alloc] init]; 21 | for (int i = 0; i < 10; i ++) { 22 | [dataSource addObject:@"请问你现在在哪里啊?我在广州天河"]; 23 | } 24 | 25 | if (!self.isFrist) { 26 | self.isFrist = YES; 27 | // 1.模拟1秒的网络加载时间 28 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 29 | if (self.requestCurrentPage) { 30 | [self endLoadMoreRefreshing]; 31 | } else { 32 | [self.dataSource removeAllObjects]; 33 | [self endPullDownRefreshing]; 34 | } 35 | 36 | [self.dataSource addObjectsFromArray:dataSource]; 37 | [self.tableView reloadData]; 38 | 39 | // 2.当下拉刷新数据刚完成之后,突然网络断了 40 | [self handleLoadMoreError]; 41 | 42 | // 3.断网10秒后,网络突然又好了 43 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(10.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 44 | // 4.模拟用户点击了一下加载更多的按钮,数据进行刷新了 45 | [self.dataSource addObjectsFromArray:dataSource]; 46 | [self.tableView reloadData]; 47 | [self endLoadMoreRefreshing]; 48 | 49 | // 5.这时候,如果没有达到转换为手动加载的情况下,仍然可以有自动加载的机制 50 | }); 51 | }); 52 | 53 | } else { 54 | // 这里是点击加载更多按钮或者网络好的情况下调用 55 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 56 | [self.dataSource addObjectsFromArray:dataSource]; 57 | [self.tableView reloadData]; 58 | [self endLoadMoreRefreshing]; 59 | }); 60 | } 61 | } 62 | 63 | #pragma mark - XHRefreshControl Delegate 64 | 65 | - (UIButton *)customLoadMoreButton { 66 | UIButton *_loadMoreButton = [[UIButton alloc] initWithFrame:CGRectMake(10, 5, CGRectGetWidth(self.view.bounds) - 20, CGRectGetHeight(self.view.bounds) - 10)]; 67 | [_loadMoreButton setTitle:@"加载更多" forState:UIControlStateNormal]; 68 | _loadMoreButton.titleLabel.font = [UIFont systemFontOfSize:16]; 69 | [_loadMoreButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 70 | [_loadMoreButton setBackgroundColor:[UIColor colorWithWhite:0.922 alpha:1.000]]; 71 | [_loadMoreButton.layer setMasksToBounds:YES]; 72 | [_loadMoreButton.layer setCornerRadius:8.0]; //设置矩形四个圆角半径 73 | return _loadMoreButton; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Models/XHSegueItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHSegueItem.h 3 | // XHRefreshControlExample 4 | // 5 | // Created by 曾 宪华 on 14-7-12. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XHSegueItem : NSObject 12 | 13 | @property (nonatomic, copy) NSString *title; 14 | 15 | @property (nonatomic, copy) NSString *className; 16 | 17 | + (instancetype)initSegueItemWithTitle:(NSString *)title onClasseName:(NSString *)className; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Models/XHSegueItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHSegueItem.m 3 | // XHRefreshControlExample 4 | // 5 | // Created by 曾 宪华 on 14-7-12. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHSegueItem.h" 10 | 11 | @implementation XHSegueItem 12 | 13 | + (instancetype)initSegueItemWithTitle:(NSString *)title onClasseName:(NSString *)className { 14 | XHSegueItem *sugueItem = [[XHSegueItem alloc] init]; 15 | sugueItem.title = title; 16 | sugueItem.className = className; 17 | return sugueItem; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDate+TimeAgo.h: -------------------------------------------------------------------------------- 1 | @interface NSDate (TimeAgo) 2 | - (NSString *) timeAgoSimple; 3 | - (NSString *) timeAgo; 4 | - (NSString *) timeAgoWithLimit:(NSTimeInterval)limit; 5 | - (NSString *) timeAgoWithLimit:(NSTimeInterval)limit dateFormat:(NSDateFormatterStyle)dFormatter andTimeFormat:(NSDateFormatterStyle)tFormatter; 6 | - (NSString *) timeAgoWithLimit:(NSTimeInterval)limit dateFormatter:(NSDateFormatter *)formatter; 7 | 8 | 9 | // this method only returns "{value} {unit} ago" strings and no "yesterday"/"last month" strings 10 | - (NSString *)dateTimeAgo; 11 | 12 | // this method gives when possible the date compared to the current calendar date: "this morning"/"yesterday"/"last week"/.. 13 | // when more precision is needed (= less than 6 hours ago) it returns the same output as dateTimeAgo 14 | - (NSString *)dateTimeUntilNow; 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/ar.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhzengAIB/XHRefreshControl/8cb5e6a237fa57df6d675f1eeb969d51882df560/XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/ar.lproj/NSDateTimeAgo.strings -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/bg.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* No comment provided by engineer. */ 2 | "%d days ago" = "преди %d дена"; 3 | 4 | /* No comment provided by engineer. */ 5 | "%d hours ago" = "преди %d часа"; 6 | 7 | /* No comment provided by engineer. */ 8 | "%d minutes ago" = "преди %d минути"; 9 | 10 | /* No comment provided by engineer. */ 11 | "%d months ago" = "преди %d месеца"; 12 | 13 | /* No comment provided by engineer. */ 14 | "%d seconds ago" = "преди %d секунди"; 15 | 16 | /* No comment provided by engineer. */ 17 | "%d weeks ago" = "преди %d седмици"; 18 | 19 | /* No comment provided by engineer. */ 20 | "%d years ago" = "преди %d години"; 21 | 22 | /* No comment provided by engineer. */ 23 | "A minute ago" = "преди минута"; 24 | 25 | /* No comment provided by engineer. */ 26 | "An hour ago" = "преди час"; 27 | 28 | /* No comment provided by engineer. */ 29 | "Just now" = "току що"; 30 | 31 | /* No comment provided by engineer. */ 32 | "Last month" = "през последния месец"; 33 | 34 | /* No comment provided by engineer. */ 35 | "Last week" = "през последната седмица"; 36 | 37 | /* No comment provided by engineer. */ 38 | "Last year" = "през последната година"; 39 | 40 | /* No comment provided by engineer. */ 41 | "Yesterday" = "вчера"; 42 | 43 | /* No comment provided by engineer. */ 44 | "1 year ago" = "преди 1 година"; 45 | 46 | /* No comment provided by engineer. */ 47 | "1 month ago" = "преди 1 месец"; 48 | 49 | /* No comment provided by engineer. */ 50 | "1 week ago" = "преди 1 седмица"; 51 | 52 | /* No comment provided by engineer. */ 53 | "1 day ago" = "преди 1 ден"; 54 | 55 | /* No comment provided by engineer. */ 56 | "This morning" = "тази сутрин"; 57 | 58 | /* No comment provided by engineer. */ 59 | "This afternoon" = "тази вечер"; 60 | 61 | /* No comment provided by engineer. */ 62 | "Today" = "днес"; 63 | 64 | /* No comment provided by engineer. */ 65 | "This week" = "тази седмица"; 66 | 67 | /* No comment provided by engineer. */ 68 | "This month" = "този месец"; 69 | 70 | /* No comment provided by engineer. */ 71 | "This year" = "тази година"; 72 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/cs.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* No comment provided by engineer. */ 2 | "%d days ago" = "Před %d dny"; 3 | 4 | /* No comment provided by engineer. */ 5 | "%d hours ago" = "Před %d hodinami"; 6 | 7 | /* No comment provided by engineer. */ 8 | "%d minutes ago" = "Před %d minutami"; 9 | 10 | /* No comment provided by engineer. */ 11 | "%d months ago" = "Před %d měsíci"; 12 | 13 | /* No comment provided by engineer. */ 14 | "%d seconds ago" = "Před %d sekundami"; 15 | 16 | /* No comment provided by engineer. */ 17 | "%d weeks ago" = "Před %d týdny"; 18 | 19 | /* No comment provided by engineer. */ 20 | "%d years ago" = "Před %d lety"; 21 | 22 | /* No comment provided by engineer. */ 23 | "A minute ago" = "Před minutou"; 24 | 25 | /* No comment provided by engineer. */ 26 | "An hour ago" = "Před hodinou"; 27 | 28 | /* No comment provided by engineer. */ 29 | "Just now" = "Právě teď"; 30 | 31 | /* No comment provided by engineer. */ 32 | "Last month" = "Minulý měsíc"; 33 | 34 | /* No comment provided by engineer. */ 35 | "Last week" = "Minulý týden"; 36 | 37 | /* No comment provided by engineer. */ 38 | "Last year" = "Minulý rok"; 39 | 40 | /* No comment provided by engineer. */ 41 | "Yesterday" = "Včera"; 42 | 43 | /* No comment provided by engineer. */ 44 | "1 year ago" = "Před rokem"; 45 | 46 | /* No comment provided by engineer. */ 47 | "1 month ago" = "Před měsícem"; 48 | 49 | /* No comment provided by engineer. */ 50 | "1 week ago" = "Před týdnem"; 51 | 52 | /* No comment provided by engineer. */ 53 | "1 day ago" = "Předevčírem"; 54 | 55 | /* No comment provided by engineer. */ 56 | "This morning" = "Dnes dopoledne"; 57 | 58 | /* No comment provided by engineer. */ 59 | "This afternoon" = "Dnes odpoledne"; 60 | 61 | /* No comment provided by engineer. */ 62 | "Today" = "Dnes"; 63 | 64 | /* No comment provided by engineer. */ 65 | "This week" = "Tento týden"; 66 | 67 | /* No comment provided by engineer. */ 68 | "This month" = "Tento měsíc"; 69 | 70 | /* No comment provided by engineer. */ 71 | "This year" = "Letos"; 72 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/da.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* No comment provided by engineer. */ 2 | "%d days ago" = "%d dage siden"; 3 | 4 | /* No comment provided by engineer. */ 5 | "%d hours ago" = "%d timer siden"; 6 | 7 | /* No comment provided by engineer. */ 8 | "%d minutes ago" = "%d minutter siden"; 9 | 10 | /* No comment provided by engineer. */ 11 | "%d months ago" = "%d måneder siden"; 12 | 13 | /* No comment provided by engineer. */ 14 | "%d seconds ago" = "%d sekunder siden"; 15 | 16 | /* No comment provided by engineer. */ 17 | "%d weeks ago" = "%d uger siden"; 18 | 19 | /* No comment provided by engineer. */ 20 | "%d years ago" = "%d år siden"; 21 | 22 | /* No comment provided by engineer. */ 23 | "A minute ago" = "Et minut siden"; 24 | 25 | /* No comment provided by engineer. */ 26 | "An hour ago" = "En time siden"; 27 | 28 | /* No comment provided by engineer. */ 29 | "Just now" = "Lige nu"; 30 | 31 | /* No comment provided by engineer. */ 32 | "Last month" = "Sidste måned"; 33 | 34 | /* No comment provided by engineer. */ 35 | "Last week" = "Sidste uge"; 36 | 37 | /* No comment provided by engineer. */ 38 | "Last year" = "Sidste år"; 39 | 40 | /* No comment provided by engineer. */ 41 | "Yesterday" = "I går"; 42 | 43 | /* No comment provided by engineer. */ 44 | "1 year ago" = "1 år siden"; 45 | 46 | /* No comment provided by engineer. */ 47 | "1 month ago" = "1 måned siden"; 48 | 49 | /* No comment provided by engineer. */ 50 | "1 week ago" = "1 uge siden"; 51 | 52 | /* No comment provided by engineer. */ 53 | "1 day ago" = "1 dag siden"; 54 | 55 | /* No comment provided by engineer. */ 56 | "This morning" = "Her til morgen"; 57 | 58 | /* No comment provided by engineer. */ 59 | "This afternoon" = "Her til eftermiddag"; 60 | 61 | /* No comment provided by engineer. */ 62 | "Today" = "I dag"; 63 | 64 | /* No comment provided by engineer. */ 65 | "This week" = "Denne uge"; 66 | 67 | /* No comment provided by engineer. */ 68 | "This month" = "Denne måned"; 69 | 70 | /* No comment provided by engineer. */ 71 | "This year" = "Dette år"; -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/de.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* No comment provided by engineer. */ 2 | "%d days ago" = "Vor %d Tagen"; 3 | 4 | /* No comment provided by engineer. */ 5 | "%d hours ago" = "Vor %d Stunden"; 6 | 7 | /* No comment provided by engineer. */ 8 | "%d minutes ago" = "Vor %d Minuten"; 9 | 10 | /* No comment provided by engineer. */ 11 | "%d months ago" = "Vor %d Monaten"; 12 | 13 | /* No comment provided by engineer. */ 14 | "%d seconds ago" = "Vor %d Sekunden"; 15 | 16 | /* No comment provided by engineer. */ 17 | "%d weeks ago" = "Vor %d Wochen"; 18 | 19 | /* No comment provided by engineer. */ 20 | "%d years ago" = "Vor %d Jahren"; 21 | 22 | /* No comment provided by engineer. */ 23 | "A minute ago" = "Vor einer Minute"; 24 | 25 | /* No comment provided by engineer. */ 26 | "An hour ago" = "Vor einer Stunde"; 27 | 28 | /* No comment provided by engineer. */ 29 | "Just now" = "Gerade eben"; 30 | 31 | /* No comment provided by engineer. */ 32 | "Last month" = "Letzten Monat"; 33 | 34 | /* No comment provided by engineer. */ 35 | "Last week" = "Letzte Woche"; 36 | 37 | /* No comment provided by engineer. */ 38 | "Last year" = "Letztes Jahr"; 39 | 40 | /* No comment provided by engineer. */ 41 | "Yesterday" = "Gestern"; 42 | 43 | /* No comment provided by engineer. */ 44 | "1 year ago" = "Vor 1 Jahr"; 45 | 46 | /* No comment provided by engineer. */ 47 | "1 month ago" = "Vor 1 Monat"; 48 | 49 | /* No comment provided by engineer. */ 50 | "1 week ago" = "Vor 1 Woche"; 51 | 52 | /* No comment provided by engineer. */ 53 | "1 day ago" = "Vor 1 Tag"; 54 | 55 | /* No comment provided by engineer. */ 56 | "This morning" = "Heute Morgen"; 57 | 58 | /* No comment provided by engineer. */ 59 | "This afternoon" = "Heute Nachmittag"; 60 | 61 | /* No comment provided by engineer. */ 62 | "Today" = "Heute"; 63 | 64 | /* No comment provided by engineer. */ 65 | "This week" = "Diese Woche"; 66 | 67 | /* No comment provided by engineer. */ 68 | "This month" = "Diesen Monat"; 69 | 70 | /* No comment provided by engineer. */ 71 | "This year" = "Dieses Jahr"; 72 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/en.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* No comment provided by engineer. */ 2 | "%d days ago" = "%d days ago"; 3 | 4 | /* No comment provided by engineer. */ 5 | "%d hours ago" = "%d hours ago"; 6 | 7 | /* No comment provided by engineer. */ 8 | "%d minutes ago" = "%d minutes ago"; 9 | 10 | /* No comment provided by engineer. */ 11 | "%d months ago" = "%d months ago"; 12 | 13 | /* No comment provided by engineer. */ 14 | "%d seconds ago" = "%d seconds ago"; 15 | 16 | /* No comment provided by engineer. */ 17 | "%d weeks ago" = "%d weeks ago"; 18 | 19 | /* No comment provided by engineer. */ 20 | "%d years ago" = "%d years ago"; 21 | 22 | /* No comment provided by engineer. */ 23 | "A minute ago" = "A minute ago"; 24 | 25 | /* No comment provided by engineer. */ 26 | "An hour ago" = "An hour ago"; 27 | 28 | /* No comment provided by engineer. */ 29 | "Just now" = "Just now"; 30 | 31 | /* No comment provided by engineer. */ 32 | "Last month" = "Last month"; 33 | 34 | /* No comment provided by engineer. */ 35 | "Last week" = "Last week"; 36 | 37 | /* No comment provided by engineer. */ 38 | "Last year" = "Last year"; 39 | 40 | /* No comment provided by engineer. */ 41 | "Yesterday" = "Yesterday"; 42 | 43 | /* No comment provided by engineer. */ 44 | "1 year ago" = "1 year ago"; 45 | 46 | /* No comment provided by engineer. */ 47 | "1 month ago" = "1 month ago"; 48 | 49 | /* No comment provided by engineer. */ 50 | "1 week ago" = "1 week ago"; 51 | 52 | /* No comment provided by engineer. */ 53 | "1 day ago" = "1 day ago"; 54 | 55 | /* No comment provided by engineer. */ 56 | "This morning" = "This morning"; 57 | 58 | /* No comment provided by engineer. */ 59 | "This afternoon" = "This afternoon"; 60 | 61 | /* No comment provided by engineer. */ 62 | "Today" = "Today"; 63 | 64 | /* No comment provided by engineer. */ 65 | "This week" = "This week"; 66 | 67 | /* No comment provided by engineer. */ 68 | "This month" = "This month"; 69 | 70 | /* No comment provided by engineer. */ 71 | "This year" = "This year"; 72 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/es.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* No comment provided by engineer. */ 2 | "%d days ago" = "Hace %d días"; 3 | 4 | /* No comment provided by engineer. */ 5 | "%d hours ago" = "Hace %d horas"; 6 | 7 | /* No comment provided by engineer. */ 8 | "%d minutes ago" = "Hace %d minutos"; 9 | 10 | /* No comment provided by engineer. */ 11 | "%d months ago" = "Hace %d meses"; 12 | 13 | /* No comment provided by engineer. */ 14 | "%d seconds ago" = "Hace %d segundos"; 15 | 16 | /* No comment provided by engineer. */ 17 | "%d weeks ago" = "Hace %d semanas"; 18 | 19 | /* No comment provided by engineer. */ 20 | "%d years ago" = "Hace %d años"; 21 | 22 | /* No comment provided by engineer. */ 23 | "A minute ago" = "Hace un minuto"; 24 | 25 | /* No comment provided by engineer. */ 26 | "An hour ago" = "Hace una hora"; 27 | 28 | /* No comment provided by engineer. */ 29 | "Just now" = "Ahora mismo"; 30 | 31 | /* No comment provided by engineer. */ 32 | "Last month" = "El mes pasado"; 33 | 34 | /* No comment provided by engineer. */ 35 | "Last week" = "La semana pasada"; 36 | 37 | /* No comment provided by engineer. */ 38 | "Last year" = "El año pasado"; 39 | 40 | /* No comment provided by engineer. */ 41 | "Yesterday" = "Ayer"; 42 | 43 | /* No comment provided by engineer. */ 44 | "1 year ago" = "Hace un año"; 45 | 46 | /* No comment provided by engineer. */ 47 | "1 month ago" = "Hace un mes"; 48 | 49 | /* No comment provided by engineer. */ 50 | "1 week ago" = "Hace una semana"; 51 | 52 | /* No comment provided by engineer. */ 53 | "1 day ago" = "Hace un día"; 54 | 55 | /* No comment provided by engineer. */ 56 | "This morning" = "Esta mañana"; 57 | 58 | /* No comment provided by engineer. */ 59 | "This afternoon" = "Esta tarde"; 60 | 61 | /* No comment provided by engineer. */ 62 | "Today" = "Hoy"; 63 | 64 | /* No comment provided by engineer. */ 65 | "This week" = "Esta semana"; 66 | 67 | /* No comment provided by engineer. */ 68 | "This month" = "Este mes"; 69 | 70 | /* No comment provided by engineer. */ 71 | "This year" = "Este año"; 72 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/fi.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* No comment provided by engineer. */ 2 | "%d days ago" = "%d päivää sitten"; 3 | 4 | /* No comment provided by engineer. */ 5 | "%d hours ago" = "%d tuntia sitten"; 6 | 7 | /* No comment provided by engineer. */ 8 | "%d minutes ago" = "%d minuuttia sitten"; 9 | 10 | /* No comment provided by engineer. */ 11 | "%d months ago" = "%d kuukautta sitten"; 12 | 13 | /* No comment provided by engineer. */ 14 | "%d seconds ago" = "%d sekuntia sitten"; 15 | 16 | /* No comment provided by engineer. */ 17 | "%d weeks ago" = "%d viikkoa sitten"; 18 | 19 | /* No comment provided by engineer. */ 20 | "%d years ago" = "%d vuotta sitten"; 21 | 22 | /* No comment provided by engineer. */ 23 | "A minute ago" = "Minuutti sitten"; 24 | 25 | /* No comment provided by engineer. */ 26 | "An hour ago" = "Tunti sitten"; 27 | 28 | /* No comment provided by engineer. */ 29 | "Just now" = "Juuri äsken"; 30 | 31 | /* No comment provided by engineer. */ 32 | "Last month" = "Viime kuussa"; 33 | 34 | /* No comment provided by engineer. */ 35 | "Last week" = "Viime viikolla"; 36 | 37 | /* No comment provided by engineer. */ 38 | "Last year" = "Viime vuonna"; 39 | 40 | /* No comment provided by engineer. */ 41 | "Yesterday" = "Eilen"; 42 | 43 | /* No comment provided by engineer. */ 44 | "1 year ago" = "Vuosi sitten"; 45 | 46 | /* No comment provided by engineer. */ 47 | "1 month ago" = "Kuukausi sitten"; 48 | 49 | /* No comment provided by engineer. */ 50 | "1 week ago" = "Viikko sitten"; 51 | 52 | /* No comment provided by engineer. */ 53 | "1 day ago" = "Vuorokausi sitten"; 54 | 55 | /* No comment provided by engineer. */ 56 | "This morning" = "Tänä aamuna"; 57 | 58 | /* No comment provided by engineer. */ 59 | "This afternoon" = "Tänä iltapäivänä"; 60 | 61 | /* No comment provided by engineer. */ 62 | "Today" = "Tänään"; 63 | 64 | /* No comment provided by engineer. */ 65 | "This week" = "Tällä viikolla"; 66 | 67 | /* No comment provided by engineer. */ 68 | "This month" = "Tässä kuussa"; 69 | 70 | /* No comment provided by engineer. */ 71 | "This year" = "Tänä vuonna"; 72 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/fr.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* No comment provided by engineer. */ 2 | "%d days ago" = "Il y a %d jours"; 3 | 4 | /* No comment provided by engineer. */ 5 | "%d hours ago" = "Il y a %d heures"; 6 | 7 | /* No comment provided by engineer. */ 8 | "%d minutes ago" = "Il y a %d minutes"; 9 | 10 | /* No comment provided by engineer. */ 11 | "%d months ago" = "Il y a %d mois"; 12 | 13 | /* No comment provided by engineer. */ 14 | "%d seconds ago" = "Il y a %d secondes"; 15 | 16 | /* No comment provided by engineer. */ 17 | "%d weeks ago" = "Il y a %d semaines"; 18 | 19 | /* No comment provided by engineer. */ 20 | "%d years ago" = "Il y a %d ans"; 21 | 22 | /* No comment provided by engineer. */ 23 | "A minute ago" = "Il y a une minute"; 24 | 25 | /* No comment provided by engineer. */ 26 | "An hour ago" = "Il y a une heure"; 27 | 28 | /* No comment provided by engineer. */ 29 | "Just now" = "A l'instant"; 30 | 31 | /* No comment provided by engineer. */ 32 | "Last month" = "Le mois dernier"; 33 | 34 | /* No comment provided by engineer. */ 35 | "Last week" = "La semaine dernière"; 36 | 37 | /* No comment provided by engineer. */ 38 | "Last year" = "L'année dernière"; 39 | 40 | /* No comment provided by engineer. */ 41 | "Yesterday" = "Hier"; 42 | 43 | /* No comment provided by engineer. */ 44 | "1 year ago" = "Il y a 1 an"; 45 | 46 | /* No comment provided by engineer. */ 47 | "1 month ago" = "Il y a 1 mois"; 48 | 49 | /* No comment provided by engineer. */ 50 | "1 week ago" = "Il y a 1 semaine"; 51 | 52 | /* No comment provided by engineer. */ 53 | "1 day ago" = "Il y a 1 jour"; 54 | 55 | /* No comment provided by engineer. */ 56 | "This morning" = "Ce matin"; 57 | 58 | /* No comment provided by engineer. */ 59 | "This afternoon" = "Cet après-midi"; 60 | 61 | /* No comment provided by engineer. */ 62 | "Today" = "Aujourd'hui"; 63 | 64 | /* No comment provided by engineer. */ 65 | "This week" = "Cette semaine"; 66 | 67 | /* No comment provided by engineer. */ 68 | "This month" = "Ce mois-ci"; 69 | 70 | /* No comment provided by engineer. */ 71 | "This year" = "Cette année"; 72 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/gre.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhzengAIB/XHRefreshControl/8cb5e6a237fa57df6d675f1eeb969d51882df560/XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/gre.lproj/NSDateTimeAgo.strings -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/he.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* No comment provided by engineer. */ 2 | "%d days ago" = "לפני %d ימים"; 3 | 4 | /* No comment provided by engineer. */ 5 | "%d hours ago" = "לפני %d שעות"; 6 | 7 | /* No comment provided by engineer. */ 8 | "%d minutes ago" = "לפני %d דקות"; 9 | 10 | /* No comment provided by engineer. */ 11 | "%d months ago" = "לפני %d חודשים"; 12 | 13 | /* No comment provided by engineer. */ 14 | "%d seconds ago" = "לפני %d שניות"; 15 | 16 | /* No comment provided by engineer. */ 17 | "%d weeks ago" = "לפני %d שבועות"; 18 | 19 | /* No comment provided by engineer. */ 20 | "%d years ago" = "לפני %d שנים"; 21 | 22 | /* No comment provided by engineer. */ 23 | "A minute ago" = "לפני דקה"; 24 | 25 | /* No comment provided by engineer. */ 26 | "An hour ago" = "לפני שעה"; 27 | 28 | /* No comment provided by engineer. */ 29 | "Just now" = "ממש עכשיו"; 30 | 31 | /* No comment provided by engineer. */ 32 | "Last month" = "בחודש שעבר"; 33 | 34 | /* No comment provided by engineer. */ 35 | "Last week" = "בשבוע שעבר"; 36 | 37 | /* No comment provided by engineer. */ 38 | "Last year" = "בשנה שעברה"; 39 | 40 | /* No comment provided by engineer. */ 41 | "Yesterday" = "אתמול"; 42 | 43 | /* No comment provided by engineer. */ 44 | "1 year ago" = "לפני שנה"; 45 | 46 | /* No comment provided by engineer. */ 47 | "1 month ago" = "לפני חודש"; 48 | 49 | /* No comment provided by engineer. */ 50 | "1 week ago" = "לפני שבוע"; 51 | 52 | /* No comment provided by engineer. */ 53 | "1 day ago" = "לפני יום"; 54 | 55 | /* No comment provided by engineer. */ 56 | "This morning" = "הבוקר"; 57 | 58 | /* No comment provided by engineer. */ 59 | "This afternoon" = "בצהריים"; 60 | 61 | /* No comment provided by engineer. */ 62 | "Today" = "היום"; 63 | 64 | /* No comment provided by engineer. */ 65 | "This week" = "השבוע"; 66 | 67 | /* No comment provided by engineer. */ 68 | "This month" = "החודש"; 69 | 70 | /* No comment provided by engineer. */ 71 | "This year" = "השנה"; 72 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/hu.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* No comment provided by engineer. */ 2 | "%d days ago" = "%d napja"; 3 | 4 | /* No comment provided by engineer. */ 5 | "%d hours ago" = "%d órája"; 6 | 7 | /* No comment provided by engineer. */ 8 | "%d minutes ago" = "%d perce"; 9 | 10 | /* No comment provided by engineer. */ 11 | "%d months ago" = "%d hónapja"; 12 | 13 | /* No comment provided by engineer. */ 14 | "%d seconds ago" = "%d másodperce"; 15 | 16 | /* No comment provided by engineer. */ 17 | "%d weeks ago" = "%d hete"; 18 | 19 | /* No comment provided by engineer. */ 20 | "%d years ago" = "%d éve"; 21 | 22 | /* No comment provided by engineer. */ 23 | "A minute ago" = "Egy perccel ezelőtt"; 24 | 25 | /* No comment provided by engineer. */ 26 | "An hour ago" = "Egy órával ezelőtt"; 27 | 28 | /* No comment provided by engineer. */ 29 | "Just now" = "Az imént"; 30 | 31 | /* No comment provided by engineer. */ 32 | "Last month" = "Az előző hónapban"; 33 | 34 | /* No comment provided by engineer. */ 35 | "Last week" = "Az előző héten"; 36 | 37 | /* No comment provided by engineer. */ 38 | "Last year" = "Tavaly"; 39 | 40 | /* No comment provided by engineer. */ 41 | "Yesterday" = "Tegnap"; 42 | 43 | /* No comment provided by engineer. */ 44 | "1 year ago" = "Tavaly"; 45 | 46 | /* No comment provided by engineer. */ 47 | "1 month ago" = "Egy hónapja"; 48 | 49 | /* No comment provided by engineer. */ 50 | "1 week ago" = "Egy hete"; 51 | 52 | /* No comment provided by engineer. */ 53 | "1 day ago" = "Tegnap"; 54 | 55 | /* No comment provided by engineer. */ 56 | "This morning" = "Ma reggel"; 57 | 58 | /* No comment provided by engineer. */ 59 | "This afternoon" = "Ma délután"; 60 | 61 | /* No comment provided by engineer. */ 62 | "Today" = "Ma"; 63 | 64 | /* No comment provided by engineer. */ 65 | "This week" = "Ezen a héten"; 66 | 67 | /* No comment provided by engineer. */ 68 | "This month" = "Ebben a hónapban"; 69 | 70 | /* No comment provided by engineer. */ 71 | "This year" = "Idén"; 72 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/is.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* No comment provided by engineer. */ 2 | "%d days ago" = "%d dögum síðan"; 3 | 4 | /* No comment provided by engineer. */ 5 | "%d hours ago" = "%d klst. síðan"; 6 | 7 | /* No comment provided by engineer. */ 8 | "%d minutes ago" = "%d mínútum síðan"; 9 | 10 | /* No comment provided by engineer. */ 11 | "%d months ago" = "%d mánuðum síðan"; 12 | 13 | /* No comment provided by engineer. */ 14 | "%d seconds ago" = "%d sekúndum síðan"; 15 | 16 | /* No comment provided by engineer. */ 17 | "%d weeks ago" = "%d vikum síðan"; 18 | 19 | /* No comment provided by engineer. */ 20 | "%d years ago" = "%d árum síðan"; 21 | 22 | /* No comment provided by engineer. */ 23 | "A minute ago" = "Einni mínútu síðan"; 24 | 25 | /* No comment provided by engineer. */ 26 | "An hour ago" = "Einni klst. síðan"; 27 | 28 | /* No comment provided by engineer. */ 29 | "Just now" = "Rétt í þessu"; 30 | 31 | /* No comment provided by engineer. */ 32 | "Last month" = "Í síðasta mánuði"; 33 | 34 | /* No comment provided by engineer. */ 35 | "Last week" = "Í síðustu viku"; 36 | 37 | /* No comment provided by engineer. */ 38 | "Last year" = "Á síðasta ári"; 39 | 40 | /* No comment provided by engineer. */ 41 | "Yesterday" = "Í gær"; 42 | 43 | /* No comment provided by engineer. */ 44 | "1 year ago" = "1 ári síðan"; 45 | 46 | /* No comment provided by engineer. */ 47 | "1 month ago" = "1 mánuði síðan"; 48 | 49 | /* No comment provided by engineer. */ 50 | "1 week ago" = "1 viku síðan"; 51 | 52 | /* No comment provided by engineer. */ 53 | "1 day ago" = "1 degi síðan"; 54 | 55 | /* No comment provided by engineer. */ 56 | "This morning" = "Í morgun"; 57 | 58 | /* No comment provided by engineer. */ 59 | "This afternoon" = "Síðdegis"; 60 | 61 | /* No comment provided by engineer. */ 62 | "Today" = "Í dag"; 63 | 64 | /* No comment provided by engineer. */ 65 | "This week" = "Í þessari viku"; 66 | 67 | /* No comment provided by engineer. */ 68 | "This month" = "Í þessum mánuði"; 69 | 70 | /* No comment provided by engineer. */ 71 | "This year" = "Á þessu ári"; 72 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/it.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* No comment provided by engineer. */ 2 | "%d days ago" = "%d giorni fa"; 3 | 4 | /* No comment provided by engineer. */ 5 | "%d hours ago" = "%d ore fa"; 6 | 7 | /* No comment provided by engineer. */ 8 | "%d minutes ago" = "%d minuti fa"; 9 | 10 | /* No comment provided by engineer. */ 11 | "%d months ago" = "%d mesi fa"; 12 | 13 | /* No comment provided by engineer. */ 14 | "%d seconds ago" = "%d secondi fa"; 15 | 16 | /* No comment provided by engineer. */ 17 | "%d weeks ago" = "%d settimane fa"; 18 | 19 | /* No comment provided by engineer. */ 20 | "%d years ago" = "%d anni fa"; 21 | 22 | /* No comment provided by engineer. */ 23 | "A minute ago" = "Un minuto fa"; 24 | 25 | /* No comment provided by engineer. */ 26 | "An hour ago" = "Un'ora fa"; 27 | 28 | /* No comment provided by engineer. */ 29 | "Just now" = "Ora"; 30 | 31 | /* No comment provided by engineer. */ 32 | "Last month" = "Il mese scorso"; 33 | 34 | /* No comment provided by engineer. */ 35 | "Last week" = "La settimana scorsa"; 36 | 37 | /* No comment provided by engineer. */ 38 | "Last year" = "L'anno scorso"; 39 | 40 | /* No comment provided by engineer. */ 41 | "Yesterday" = "Ieri"; 42 | 43 | /* No comment provided by engineer. */ 44 | "1 year ago" = "Un anno fa"; 45 | 46 | /* No comment provided by engineer. */ 47 | "1 month ago" = "Un mese fa"; 48 | 49 | /* No comment provided by engineer. */ 50 | "1 week ago" = "Una settimana fa"; 51 | 52 | /* No comment provided by engineer. */ 53 | "1 day ago" = "Un giorno fa"; 54 | 55 | /* No comment provided by engineer. */ 56 | "This morning" = "Questa mattina"; 57 | 58 | /* No comment provided by engineer. */ 59 | "This afternoon" = "Questo pomeriggio"; 60 | 61 | /* No comment provided by engineer. */ 62 | "Today" = "Oggi"; 63 | 64 | /* No comment provided by engineer. */ 65 | "This week" = "Questa settimana"; 66 | 67 | /* No comment provided by engineer. */ 68 | "This month" = "Questo mese"; 69 | 70 | /* No comment provided by engineer. */ 71 | "This year" = "Quest'anno"; 72 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/ja.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* No comment provided by engineer. */ 2 | "%d days ago" = "%d日前"; 3 | 4 | /* No comment provided by engineer. */ 5 | "%d hours ago" = "%d時間前"; 6 | 7 | /* No comment provided by engineer. */ 8 | "%d minutes ago" = "%d分前"; 9 | 10 | /* No comment provided by engineer. */ 11 | "%d months ago" = "%dヶ月前"; 12 | 13 | /* No comment provided by engineer. */ 14 | "%d seconds ago" = "%d秒前"; 15 | 16 | /* No comment provided by engineer. */ 17 | "%d weeks ago" = "%d週間前"; 18 | 19 | /* No comment provided by engineer. */ 20 | "%d years ago" = "%d年前"; 21 | 22 | /* No comment provided by engineer. */ 23 | "A minute ago" = "1分前"; 24 | 25 | /* No comment provided by engineer. */ 26 | "An hour ago" = "1時間前"; 27 | 28 | /* No comment provided by engineer. */ 29 | "Just now" = "たった今"; 30 | 31 | /* No comment provided by engineer. */ 32 | "Last month" = "先月"; 33 | 34 | /* No comment provided by engineer. */ 35 | "Last week" = "先週"; 36 | 37 | /* No comment provided by engineer. */ 38 | "Last year" = "去年"; 39 | 40 | /* No comment provided by engineer. */ 41 | "Yesterday" = "昨日"; 42 | 43 | /* No comment provided by engineer. */ 44 | "1 year ago" = "1年前"; 45 | 46 | /* No comment provided by engineer. */ 47 | "1 month ago" = "1ヶ月前"; 48 | 49 | /* No comment provided by engineer. */ 50 | "1 week ago" = "1週間前"; 51 | 52 | /* No comment provided by engineer. */ 53 | "1 day ago" = "1日前"; 54 | 55 | /* No comment provided by engineer. */ 56 | "This morning" = "午前"; 57 | 58 | /* No comment provided by engineer. */ 59 | "This afternoon" = "午後"; 60 | 61 | /* No comment provided by engineer. */ 62 | "Today" = "今日"; 63 | 64 | /* No comment provided by engineer. */ 65 | "This week" = "今週"; 66 | 67 | /* No comment provided by engineer. */ 68 | "This month" = "今月"; 69 | 70 | /* No comment provided by engineer. */ 71 | "This year" = "今年"; 72 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/ko.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* No comment provided by engineer. */ 2 | "%d days ago" = "%d일전"; 3 | 4 | /* No comment provided by engineer. */ 5 | "%d hours ago" = "%d시간전"; 6 | 7 | /* No comment provided by engineer. */ 8 | "%d minutes ago" = "%d분전"; 9 | 10 | /* No comment provided by engineer. */ 11 | "%d months ago" = "%d개월전"; 12 | 13 | /* No comment provided by engineer. */ 14 | "%d seconds ago" = "%d초전"; 15 | 16 | /* No comment provided by engineer. */ 17 | "%d weeks ago" = "%d주전"; 18 | 19 | /* No comment provided by engineer. */ 20 | "%d years ago" = "%d년전"; 21 | 22 | /* No comment provided by engineer. */ 23 | "A minute ago" = "1분전"; 24 | 25 | /* No comment provided by engineer. */ 26 | "An hour ago" = "1시간전"; 27 | 28 | /* No comment provided by engineer. */ 29 | "Just now" = "방금전"; 30 | 31 | /* No comment provided by engineer. */ 32 | "Last month" = "지난달"; 33 | 34 | /* No comment provided by engineer. */ 35 | "Last week" = "지난주"; 36 | 37 | /* No comment provided by engineer. */ 38 | "Last year" = "지난해"; 39 | 40 | /* No comment provided by engineer. */ 41 | "Yesterday" = "어제"; 42 | 43 | /* No comment provided by engineer. */ 44 | "1 year ago" = "1년전"; 45 | 46 | /* No comment provided by engineer. */ 47 | "1 month ago" = "1개월전"; 48 | 49 | /* No comment provided by engineer. */ 50 | "1 week ago" = "1주전"; 51 | 52 | /* No comment provided by engineer. */ 53 | "1 day ago" = "1일전"; 54 | 55 | /* No comment provided by engineer. */ 56 | "This morning" = "오늘 아침"; 57 | 58 | /* No comment provided by engineer. */ 59 | "This afternoon" = "오늘 오후"; 60 | 61 | /* No comment provided by engineer. */ 62 | "Today" = "오늘"; 63 | 64 | /* No comment provided by engineer. */ 65 | "This week" = "이번주"; 66 | 67 | /* No comment provided by engineer. */ 68 | "This month" = "이번달"; 69 | 70 | /* No comment provided by engineer. */ 71 | "This year" = "올해"; 72 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/lv.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | "1 year ago" = "Pirms gada"; 2 | "1 month ago" = "Pirms mēneša"; 3 | "1 week ago" = "Pirms nedēļas"; 4 | "1 day ago" = "Pirms dienas"; 5 | "A minute ago" = "Pirms minūtes"; 6 | "An hour ago" = "Pirms stundas"; 7 | "Last month" = "Pagājušajā mēnesī"; 8 | "Last week" = "Pagājušajā nedēļā"; 9 | "Last year" = "Pagājušajā gadā"; 10 | "Just now" = "Tikko"; 11 | "Today" = "Šodien"; 12 | "Yesterday" = "Vakar"; 13 | "This morning" = "Šorīt"; 14 | "This afternoon" = "Pēcpusdienā"; 15 | "This week" = "Šonedēļ"; 16 | "This month" = "Šomēnes"; 17 | "This year" = "Šogad"; 18 | "%d seconds ago" = "Pirms %d sekundēm"; 19 | "%d minutes ago" = "Pirms %d minūtēm"; 20 | "%d hours ago" = "Pirms %d stundām"; 21 | "%d days ago" = "Pirms %d dienām"; 22 | "%d weeks ago" = "Pirms %d nedēļām"; 23 | "%d months ago" = "Pirms %d mēnešiem"; 24 | "%d years ago" = "Pirms %d gadiem"; 25 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/nb.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* 2 | RULES: 3 | Assume value for (seconds, hours, minutes, days, weeks, months or years) is XXXY, Y is last digit, XY is last two digits; 4 | */ 5 | 6 | /* Y ==0 OR Y > 4 OR XY == 11; */ 7 | "%d days ago" = "%d dager siden"; 8 | 9 | /* If Y != 1 AND Y < 5; */ 10 | "%d _days ago" = "%d dager siden"; 11 | 12 | /* If Y == 1; */ 13 | "%d __days ago" = "%d dag siden"; 14 | 15 | 16 | /* Y ==0 OR Y > 4 OR XY == 11; */ 17 | "%d hours ago" = "%d timer siden"; 18 | 19 | /* If Y != 1 AND Y < 5; */ 20 | "%d _hours ago" = "%d timer siden"; 21 | 22 | /* If Y == 1; */ 23 | "%d __hours ago" = "%d time siden"; 24 | 25 | 26 | /* Y ==0 OR Y > 4 OR XY == 11; */ 27 | "%d minutes ago" = "%d minutter siden"; 28 | 29 | /* If Y != 1 AND Y < 5; */ 30 | "%d _minutes ago" = "%d minutter siden"; 31 | 32 | /* If Y == 1; */ 33 | "%d __minutes ago" = "%d minutt siden"; 34 | 35 | 36 | /* Y ==0 OR Y > 4 OR XY == 11; */ 37 | "%d months ago" = "%d måneder siden"; 38 | 39 | /* If Y != 1 AND Y < 5; */ 40 | "%d _months ago" = "%d måneder siden"; 41 | 42 | /* If Y == 1; */ 43 | "%d __months ago" = "%d måned siden"; 44 | 45 | 46 | /* Y ==0 OR Y > 4 OR XY == 11; */ 47 | "%d seconds ago" = "%d sekunder siden"; 48 | 49 | /* If Y != 1 AND Y < 5; */ 50 | "%d _seconds ago" = "%d sekunder siden"; 51 | 52 | /* If Y == 1; */ 53 | "%d __seconds ago" = "%d sekund siden"; 54 | 55 | 56 | /* Y ==0 OR Y > 4 OR XY == 11; */ 57 | "%d weeks ago" = "%d uker siden"; 58 | 59 | /* If Y != 1 AND Y < 5; */ 60 | "%d _weeks ago" = "%d uker siden"; 61 | 62 | /* If Y == 1; */ 63 | "%d __weeks ago" = "%d uke siden"; 64 | 65 | 66 | /* Y ==0 OR Y > 4 OR XY == 11; */ 67 | "%d years ago" = "%d år siden"; 68 | 69 | /* If Y != 1 AND Y < 5; */ 70 | "%d _years ago" = "%d år siden"; 71 | 72 | /* If Y == 1; */ 73 | "%d __years ago" = "%d år siden"; 74 | 75 | 76 | /* No comment provided by engineer. */ 77 | "A minute ago" = "Et minutt siden"; 78 | 79 | /* No comment provided by engineer. */ 80 | "An hour ago" = "En time siden"; 81 | 82 | /* No comment provided by engineer. */ 83 | "Just now" = "Nå"; 84 | 85 | /* No comment provided by engineer. */ 86 | "Last month" = "For en måned siden"; 87 | 88 | /* No comment provided by engineer. */ 89 | "Last week" = "For en uke siden"; 90 | 91 | /* No comment provided by engineer. */ 92 | "Last year" = "For et år siden"; 93 | 94 | /* No comment provided by engineer. */ 95 | "Yesterday" = "I går"; 96 | 97 | /* No comment provided by engineer. */ 98 | "1 year ago" = "1 år siden"; 99 | 100 | /* No comment provided by engineer. */ 101 | "1 month ago" = "1 måned siden"; 102 | 103 | /* No comment provided by engineer. */ 104 | "1 week ago" = "1 uke siden"; 105 | 106 | /* No comment provided by engineer. */ 107 | "1 day ago" = "1 dag siden"; 108 | 109 | /* No comment provided by engineer. */ 110 | "This morning" = "Denne morgenen"; 111 | 112 | /* No comment provided by engineer. */ 113 | "This afternoon" = "I ettermiddag"; 114 | 115 | /* No comment provided by engineer. */ 116 | "Today" = "I dag"; 117 | 118 | /* No comment provided by engineer. */ 119 | "This week" = "Denne uken"; 120 | 121 | /* No comment provided by engineer. */ 122 | "This month" = "Denne måneden"; 123 | 124 | /* No comment provided by engineer. */ 125 | "This year" = "Dette året"; 126 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/nl.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* No comment provided by engineer. */ 2 | "%d days ago" = "%d dagen geleden"; 3 | 4 | /* No comment provided by engineer. */ 5 | "%d hours ago" = "%d uur geleden"; 6 | 7 | /* No comment provided by engineer. */ 8 | "%d minutes ago" = "%d minuten geleden"; 9 | 10 | /* No comment provided by engineer. */ 11 | "%d months ago" = "%d maanden geleden"; 12 | 13 | /* No comment provided by engineer. */ 14 | "%d seconds ago" = "%d seconden geleden"; 15 | 16 | /* No comment provided by engineer. */ 17 | "%d weeks ago" = "%d weken geleden"; 18 | 19 | /* No comment provided by engineer. */ 20 | "%d years ago" = "%d jaar geleden"; 21 | 22 | /* No comment provided by engineer. */ 23 | "A minute ago" = "Een minuut geleden"; 24 | 25 | /* No comment provided by engineer. */ 26 | "An hour ago" = "Een uur geleden"; 27 | 28 | /* No comment provided by engineer. */ 29 | "Just now" = "Zojuist"; 30 | 31 | /* No comment provided by engineer. */ 32 | "Last month" = "Vorige maand"; 33 | 34 | /* No comment provided by engineer. */ 35 | "Last week" = "Vorige week"; 36 | 37 | /* No comment provided by engineer. */ 38 | "Last year" = "Vorig jaar"; 39 | 40 | /* No comment provided by engineer. */ 41 | "Yesterday" = "Gisteren"; 42 | 43 | /* No comment provided by engineer. */ 44 | "1 year ago" = "1 jaar geleden"; 45 | 46 | /* No comment provided by engineer. */ 47 | "1 month ago" = "1 maand geleden"; 48 | 49 | /* No comment provided by engineer. */ 50 | "1 week ago" = "1 week geleden"; 51 | 52 | /* No comment provided by engineer. */ 53 | "1 day ago" = "1 dag geleden"; 54 | 55 | /* No comment provided by engineer. */ 56 | "This morning" = "Vanmorgen"; 57 | 58 | /* No comment provided by engineer. */ 59 | "This afternoon" = "Vanmiddag"; 60 | 61 | /* No comment provided by engineer. */ 62 | "Today" = "Vandaag"; 63 | 64 | /* No comment provided by engineer. */ 65 | "This week" = "Deze week"; 66 | 67 | /* No comment provided by engineer. */ 68 | "This month" = "Deze maand"; 69 | 70 | /* No comment provided by engineer. */ 71 | "This year" = "Dit jaar"; 72 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/pl.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* No comment provided by engineer. */ 2 | "%d days ago" = "%d dni temu"; 3 | 4 | /* No comment provided by engineer. */ 5 | "%d hours ago" = "%d godzin(y) temu"; 6 | 7 | /* No comment provided by engineer. */ 8 | "%d minutes ago" = "%d minut(y) temu"; 9 | 10 | /* No comment provided by engineer. */ 11 | "%d months ago" = "%d miesice/-y temu"; 12 | 13 | /* No comment provided by engineer. */ 14 | "%d seconds ago" = "%d sekund(y) temu"; 15 | 16 | /* No comment provided by engineer. */ 17 | "%d weeks ago" = "%d tygodni(e) temu"; 18 | 19 | /* No comment provided by engineer. */ 20 | "%d years ago" = "%d lat(a) temu"; 21 | 22 | /* No comment provided by engineer. */ 23 | "A minute ago" = "Minut temu"; 24 | 25 | /* No comment provided by engineer. */ 26 | "An hour ago" = "Godzin temu"; 27 | 28 | /* No comment provided by engineer. */ 29 | "Just now" = "W tej chwili"; 30 | 31 | /* No comment provided by engineer. */ 32 | "Last month" = "W zeszBym miesicu"; 33 | 34 | /* No comment provided by engineer. */ 35 | "Last week" = "W zeszBym tygodniu"; 36 | 37 | /* No comment provided by engineer. */ 38 | "Last year" = "W zeszBym roku"; 39 | 40 | /* No comment provided by engineer. */ 41 | "Yesterday" = "Wczoraj"; 42 | 43 | /* No comment provided by engineer. */ 44 | "1 year ago" = "1 rok temu"; 45 | 46 | /* No comment provided by engineer. */ 47 | "1 month ago" = "1 miesic temu"; 48 | 49 | /* No comment provided by engineer. */ 50 | "1 week ago" = "1 tydzieD temu"; 51 | 52 | /* No comment provided by engineer. */ 53 | "1 day ago" = "1 dzieD temu"; 54 | 55 | /* No comment provided by engineer. */ 56 | "This morning" = "Dzi[ rano"; 57 | 58 | /* No comment provided by engineer. */ 59 | "This afternoon" = "Dzi[ po poBudniu"; 60 | 61 | /* No comment provided by engineer. */ 62 | "Today" = "Dzisiaj"; 63 | 64 | /* No comment provided by engineer. */ 65 | "This week" = "W tym tygodniu"; 66 | 67 | /* No comment provided by engineer. */ 68 | "This month" = "W tym miesicu"; 69 | 70 | /* No comment provided by engineer. */ 71 | "This year" = "W tym roku"; 72 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/pt-PT.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* No comment provided by engineer. */ 2 | "%d days ago" = "%d dias atrás"; 3 | 4 | /* No comment provided by engineer. */ 5 | "%d hours ago" = "%d horas atrás"; 6 | 7 | /* No comment provided by engineer. */ 8 | "%d minutes ago" = "%d minutos atrás"; 9 | 10 | /* No comment provided by engineer. */ 11 | "%d months ago" = "%d meses atrás"; 12 | 13 | /* No comment provided by engineer. */ 14 | "%d seconds ago" = "%d segundos atrás"; 15 | 16 | /* No comment provided by engineer. */ 17 | "%d weeks ago" = "%d semanas atrás"; 18 | 19 | /* No comment provided by engineer. */ 20 | "%d years ago" = "%d anos atrás"; 21 | 22 | /* No comment provided by engineer. */ 23 | "A minute ago" = "Um minute atrás"; 24 | 25 | /* No comment provided by engineer. */ 26 | "An hour ago" = "Uma hora atrás"; 27 | 28 | /* No comment provided by engineer. */ 29 | "Just now" = "Agora mesmo"; 30 | 31 | /* No comment provided by engineer. */ 32 | "Last month" = "Mês passado"; 33 | 34 | /* No comment provided by engineer. */ 35 | "Last week" = "Semana passada"; 36 | 37 | /* No comment provided by engineer. */ 38 | "Last year" = "Ano passado"; 39 | 40 | /* No comment provided by engineer. */ 41 | "Yesterday" = "Ontem"; 42 | 43 | /* No comment provided by engineer. */ 44 | "1 year ago" = "1 ano passado"; 45 | 46 | /* No comment provided by engineer. */ 47 | "1 month ago" = "1 mês atrás"; 48 | 49 | /* No comment provided by engineer. */ 50 | "1 week ago" = "1 semana atrás"; 51 | 52 | /* No comment provided by engineer. */ 53 | "1 day ago" = "1 dia atrás"; 54 | 55 | /* No comment provided by engineer. */ 56 | "This morning" = "Esta manhã"; 57 | 58 | /* No comment provided by engineer. */ 59 | "This afternoon" = "Esta tarde"; 60 | 61 | /* No comment provided by engineer. */ 62 | "Today" = "Hoje"; 63 | 64 | /* No comment provided by engineer. */ 65 | "This week" = "Esta semana"; 66 | 67 | /* No comment provided by engineer. */ 68 | "This month" = "Este mês"; 69 | 70 | /* No comment provided by engineer. */ 71 | "This year" = "Este ano"; 72 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/pt.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* No comment provided by engineer. */ 2 | "%d days ago" = "%d dias atrás"; 3 | 4 | /* No comment provided by engineer. */ 5 | "%d hours ago" = "%d horas atrás"; 6 | 7 | /* No comment provided by engineer. */ 8 | "%d minutes ago" = "%d minutos atrás"; 9 | 10 | /* No comment provided by engineer. */ 11 | "%d months ago" = "%d meses atrás"; 12 | 13 | /* No comment provided by engineer. */ 14 | "%d seconds ago" = "%d segundos atrás"; 15 | 16 | /* No comment provided by engineer. */ 17 | "%d weeks ago" = "%d semanas atrás"; 18 | 19 | /* No comment provided by engineer. */ 20 | "%d years ago" = "%d anos atrás"; 21 | 22 | /* No comment provided by engineer. */ 23 | "A minute ago" = "Há um minuto"; 24 | 25 | /* No comment provided by engineer. */ 26 | "An hour ago" = "Há uma hora"; 27 | 28 | /* No comment provided by engineer. */ 29 | "Just now" = "Agora"; 30 | 31 | /* No comment provided by engineer. */ 32 | "Last month" = "Mês passado"; 33 | 34 | /* No comment provided by engineer. */ 35 | "Last week" = "Semana passada"; 36 | 37 | /* No comment provided by engineer. */ 38 | "Last year" = "Ano passado"; 39 | 40 | /* No comment provided by engineer. */ 41 | "Yesterday" = "Ontem"; 42 | 43 | /* No comment provided by engineer. */ 44 | "1 year ago" = "1 ano atrás"; 45 | 46 | /* No comment provided by engineer. */ 47 | "1 month ago" = "1 mês atrás"; 48 | 49 | /* No comment provided by engineer. */ 50 | "1 week ago" = "1 semana atrás"; 51 | 52 | /* No comment provided by engineer. */ 53 | "1 day ago" = "1 dia atrás"; 54 | 55 | /* No comment provided by engineer. */ 56 | "This morning" = "Esta manhã"; 57 | 58 | /* No comment provided by engineer. */ 59 | "This afternoon" = "Esta tarde"; 60 | 61 | /* No comment provided by engineer. */ 62 | "Today" = "Hoje"; 63 | 64 | /* No comment provided by engineer. */ 65 | "This week" = "Esta semana"; 66 | 67 | /* No comment provided by engineer. */ 68 | "This month" = "Este mês"; 69 | 70 | /* No comment provided by engineer. */ 71 | "This year" = "Este ano"; 72 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/ro.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* No comment provided by engineer. */ 2 | "%d days ago" = "În urmă cu %d zile"; 3 | 4 | /* No comment provided by engineer. */ 5 | "%d hours ago" = "În urmă cu %d ore"; 6 | 7 | /* No comment provided by engineer. */ 8 | "%d minutes ago" = "În urmă cu %d minute"; 9 | 10 | /* No comment provided by engineer. */ 11 | "%d months ago" = "În urmă cu %d luni"; 12 | 13 | /* No comment provided by engineer. */ 14 | "%d seconds ago" = "În urmă cu %d secunde"; 15 | 16 | /* No comment provided by engineer. */ 17 | "%d weeks ago" = "În urmă cu %d săptămâni"; 18 | 19 | /* No comment provided by engineer. */ 20 | "%d years ago" = "În urmă cu %d ani"; 21 | 22 | /* No comment provided by engineer. */ 23 | "A minute ago" = "În urmă cu 1 minut"; 24 | 25 | /* No comment provided by engineer. */ 26 | "An hour ago" = "În urmă cu 1 oră"; 27 | 28 | /* No comment provided by engineer. */ 29 | "Just now" = "Acum câteva momente"; 30 | 31 | /* No comment provided by engineer. */ 32 | "Last month" = "Luna trecută"; 33 | 34 | /* No comment provided by engineer. */ 35 | "Last week" = "Săptămâna trecută"; 36 | 37 | /* No comment provided by engineer. */ 38 | "Last year" = "Anul trecut"; 39 | 40 | /* No comment provided by engineer. */ 41 | "Yesterday" = "Ieri"; 42 | 43 | /* No comment provided by engineer. */ 44 | "1 year ago" = "În urmă cu 1 an"; 45 | 46 | /* No comment provided by engineer. */ 47 | "1 month ago" = "În urmă cu 1 lună"; 48 | 49 | /* No comment provided by engineer. */ 50 | "1 week ago" = "În urmă cu 1 săptămână"; 51 | 52 | /* No comment provided by engineer. */ 53 | "1 day ago" = "În urmă cu 1 zi"; 54 | 55 | /* No comment provided by engineer. */ 56 | "This morning" = "Azi dimineață"; 57 | 58 | /* No comment provided by engineer. */ 59 | "This afternoon" = "În această seară"; 60 | 61 | /* No comment provided by engineer. */ 62 | "Today" = "Astăzi"; 63 | 64 | /* No comment provided by engineer. */ 65 | "This week" = "Săptămâna aceasta"; 66 | 67 | /* No comment provided by engineer. */ 68 | "This month" = "Luna aceasta"; 69 | 70 | /* No comment provided by engineer. */ 71 | "This year" = "Anul acesta"; -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/ru.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* 2 | RULES: 3 | Assume value for (seconds, hours, minutes, days, weeks, months or years) is XXXY, Y is last digit, XY is last two digits; 4 | */ 5 | 6 | /* Y == 0 OR Y > 4 OR (XY > 10 AND XY < 15); */ 7 | "%d days ago" = "%d дней назад"; 8 | 9 | /* Y > 1 AND Y < 5 AND (XY < 10 OR XY > 20); */ 10 | "%d _days ago" = "%d дня назад"; 11 | 12 | /* Y == 1 AND XY != 11; */ 13 | "%d __days ago" = "%d день назад"; 14 | 15 | 16 | /* Y == 0 OR Y > 4 OR (XY > 10 AND XY < 15); */ 17 | "%d hours ago" = "%d часов назад"; 18 | 19 | /* Y > 1 AND Y < 5 AND (XY < 10 OR XY > 20); */ 20 | "%d _hours ago" = "%d часа назад"; 21 | 22 | /* Y == 1 AND XY != 11; */ 23 | "%d __hours ago" = "%d час назад"; 24 | 25 | 26 | /* Y == 0 OR Y > 4 OR (XY > 10 AND XY < 15); */ 27 | "%d minutes ago" = "%d минут назад"; 28 | 29 | /* Y > 1 AND Y < 5 AND (XY < 10 OR XY > 20); */ 30 | "%d _minutes ago" = "%d минуты назад"; 31 | 32 | /* Y == 1 AND XY != 11; */ 33 | "%d __minutes ago" = "%d минуту назад"; 34 | 35 | 36 | /* Y == 0 OR Y > 4 OR (XY > 10 AND XY < 15); */ 37 | "%d months ago" = "%d месяцев назад"; 38 | 39 | /* Y > 1 AND Y < 5 AND (XY < 10 OR XY > 20); */ 40 | "%d _months ago" = "%d месяца назад"; 41 | 42 | /* Y == 1 AND XY != 11; */ 43 | "%d __months ago" = "%d месяц назад"; 44 | 45 | 46 | /* Y == 0 OR Y > 4 OR (XY > 10 AND XY < 15); */ 47 | "%d seconds ago" = "%d секунд назад"; 48 | 49 | /* Y > 1 AND Y < 5 AND (XY < 10 OR XY > 20); */ 50 | "%d _seconds ago" = "%d секунды назад"; 51 | 52 | /* Y == 1 AND XY != 11; */ 53 | "%d __seconds ago" = "%d секунду назад"; 54 | 55 | 56 | /* Y == 0 OR Y > 4 OR (XY > 10 AND XY < 15); */ 57 | "%d weeks ago" = "%d недель назад"; 58 | 59 | /* Y > 1 AND Y < 5 AND (XY < 10 OR XY > 20); */ 60 | "%d _weeks ago" = "%d недели назад"; 61 | 62 | /* Y == 1 AND XY != 11; */ 63 | "%d __weeks ago" = "%d неделю назад"; 64 | 65 | 66 | /* Y == 0 OR Y > 4 OR (XY > 10 AND XY < 15); */ 67 | "%d years ago" = "%d лет назад"; 68 | 69 | /* Y > 1 AND Y < 5 AND (XY < 10 OR XY > 20); */ 70 | "%d _years ago" = "%d года назад"; 71 | 72 | /* Y == 1 AND XY != 11; */ 73 | "%d __years ago" = "%d год назад"; 74 | 75 | 76 | /* No comment provided by engineer. */ 77 | "A minute ago" = "Минуту назад"; 78 | 79 | /* No comment provided by engineer. */ 80 | "An hour ago" = "Час назад"; 81 | 82 | /* No comment provided by engineer. */ 83 | "Just now" = "Только что"; 84 | 85 | /* No comment provided by engineer. */ 86 | "Last month" = "Месяц назад"; 87 | 88 | /* No comment provided by engineer. */ 89 | "Last week" = "Неделю назад"; 90 | 91 | /* No comment provided by engineer. */ 92 | "Last year" = "Год назад"; 93 | 94 | /* No comment provided by engineer. */ 95 | "Yesterday" = "Вчера"; 96 | 97 | /* No comment provided by engineer. */ 98 | "1 year ago" = "1 год назад"; 99 | 100 | /* No comment provided by engineer. */ 101 | "1 month ago" = "1 месяц назад"; 102 | 103 | /* No comment provided by engineer. */ 104 | "1 week ago" = "1 неделю назад"; 105 | 106 | /* No comment provided by engineer. */ 107 | "1 day ago" = "1 день назад"; 108 | 109 | /* No comment provided by engineer. */ 110 | "This morning" = "Этим утром"; 111 | 112 | /* No comment provided by engineer. */ 113 | "This afternoon" = "Этим днём"; 114 | 115 | /* No comment provided by engineer. */ 116 | "Today" = "Сегодня"; 117 | 118 | /* No comment provided by engineer. */ 119 | "This week" = "На этой неделе"; 120 | 121 | /* No comment provided by engineer. */ 122 | "This month" = "В этом месяце"; 123 | 124 | /* No comment provided by engineer. */ 125 | "This year" = "В этом году"; 126 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/sv.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhzengAIB/XHRefreshControl/8cb5e6a237fa57df6d675f1eeb969d51882df560/XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/sv.lproj/NSDateTimeAgo.strings -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/th.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhzengAIB/XHRefreshControl/8cb5e6a237fa57df6d675f1eeb969d51882df560/XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/th.lproj/NSDateTimeAgo.strings -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/tr.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* No comment provided by engineer. */ 2 | "%d days ago" = "%d gün önce"; 3 | 4 | /* No comment provided by engineer. */ 5 | "%d hours ago" = "%d saat önce"; 6 | 7 | /* No comment provided by engineer. */ 8 | "%d minutes ago" = "%d dakika önce"; 9 | 10 | /* No comment provided by engineer. */ 11 | "%d months ago" = "%d ay önce"; 12 | 13 | /* No comment provided by engineer. */ 14 | "%d seconds ago" = "%d saniye önce"; 15 | 16 | /* No comment provided by engineer. */ 17 | "%d weeks ago" = "%d hafta önce"; 18 | 19 | /* No comment provided by engineer. */ 20 | "%d years ago" = "%d yıl önce"; 21 | 22 | /* No comment provided by engineer. */ 23 | "A minute ago" = "Bir dakika önce"; 24 | 25 | /* No comment provided by engineer. */ 26 | "An hour ago" = "Bir saat önce"; 27 | 28 | /* No comment provided by engineer. */ 29 | "Just now" = "Şimdi"; 30 | 31 | /* No comment provided by engineer. */ 32 | "Last month" = "Geçen ay"; 33 | 34 | /* No comment provided by engineer. */ 35 | "Last week" = "Geçen hafta"; 36 | 37 | /* No comment provided by engineer. */ 38 | "Last year" = "Geçen yıl"; 39 | 40 | /* No comment provided by engineer. */ 41 | "Yesterday" = "Dün"; 42 | 43 | /* No comment provided by engineer. */ 44 | "1 year ago" = "1 yıl önce"; 45 | 46 | /* No comment provided by engineer. */ 47 | "1 month ago" = "1 ay önce"; 48 | 49 | /* No comment provided by engineer. */ 50 | "1 week ago" = "1 hafta önce"; 51 | 52 | /* No comment provided by engineer. */ 53 | "1 day ago" = "1 gün önce"; 54 | 55 | /* No comment provided by engineer. */ 56 | "This morning" = "Bu sabah"; 57 | 58 | /* No comment provided by engineer. */ 59 | "This afternoon" = "Öğleden sonra"; 60 | 61 | /* No comment provided by engineer. */ 62 | "Today" = "Bugün"; 63 | 64 | /* No comment provided by engineer. */ 65 | "This week" = "Bu hafta"; 66 | 67 | /* No comment provided by engineer. */ 68 | "This month" = "Bu ay"; 69 | 70 | /* No comment provided by engineer. */ 71 | "This year" = "Bu yıl"; 72 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/uk.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* 2 | RULES: 3 | Assume value for (seconds, hours, minutes, days, weeks, months or years) is XXXY, Y is last digit, XY is last two digits; 4 | */ 5 | 6 | /* Y == 0 OR Y > 4 OR (XY > 10 AND XY < 15); */ 7 | "%d days ago" = "%d днів тому"; 8 | 9 | /* Y > 1 AND Y < 5 AND (XY < 10 OR XY > 20); */ 10 | "%d _days ago" = "%d дня тому"; 11 | 12 | /* Y == 1 AND XY != 11; */ 13 | "%d __days ago" = "%d день тому"; 14 | 15 | 16 | /* Y == 0 OR Y > 4 OR (XY > 10 AND XY < 15); */ 17 | "%d hours ago" = "%d годин тому"; 18 | 19 | /* Y > 1 AND Y < 5 AND (XY < 10 OR XY > 20); */ 20 | "%d _hours ago" = "%d години тому"; 21 | 22 | /* Y == 1 AND XY != 11; */ 23 | "%d __hours ago" = "%d годину тому"; 24 | 25 | 26 | /* Y == 0 OR Y > 4 OR (XY > 10 AND XY < 15); */ 27 | "%d minutes ago" = "%d хвилин тому"; 28 | 29 | /* Y > 1 AND Y < 5 AND (XY < 10 OR XY > 20); */ 30 | "%d _minutes ago" = "%d хвилини тому"; 31 | 32 | /* Y == 1 AND XY != 11; */ 33 | "%d __minutes ago" = "%d хвилину тому"; 34 | 35 | 36 | /* Y == 0 OR Y > 4 OR (XY > 10 AND XY < 15); */ 37 | "%d months ago" = "%d місяців тому"; 38 | 39 | /* Y > 1 AND Y < 5 AND (XY < 10 OR XY > 20); */ 40 | "%d _months ago" = "%d місяця тому"; 41 | 42 | /* Y == 1 AND XY != 11; */ 43 | "%d __months ago" = "%d місяць тому"; 44 | 45 | 46 | /* Y == 0 OR Y > 4 OR (XY > 10 AND XY < 15); */ 47 | "%d seconds ago" = "%d секунд тому"; 48 | 49 | /* Y > 1 AND Y < 5 AND (XY < 10 OR XY > 20); */ 50 | "%d _seconds ago" = "%d секунди тому"; 51 | 52 | /* Y == 1 AND XY != 11; */ 53 | "%d __seconds ago" = "%d секунду тому"; 54 | 55 | 56 | /* Y == 0 OR Y > 4 OR (XY > 10 AND XY < 15); */ 57 | "%d weeks ago" = "%d тижднів тому"; 58 | 59 | /* Y > 1 AND Y < 5 AND (XY < 10 OR XY > 20); */ 60 | "%d _weeks ago" = "%d тиждні тому"; 61 | 62 | /* Y == 1 AND XY != 11; */ 63 | "%d __weeks ago" = "%d тиждень тому"; 64 | 65 | 66 | /* Y == 0 OR Y > 4 OR (XY > 10 AND XY < 15); */ 67 | "%d years ago" = "%d років тому"; 68 | 69 | /* Y > 1 AND Y < 5 AND (XY < 10 OR XY > 20); */ 70 | "%d _years ago" = "%d роки тому"; 71 | 72 | /* Y == 1 AND XY != 11; */ 73 | "%d __years ago" = "%d рік тому"; 74 | 75 | 76 | /* No comment provided by engineer. */ 77 | "A minute ago" = "Хвилину тому"; 78 | 79 | /* No comment provided by engineer. */ 80 | "An hour ago" = "Годину тому"; 81 | 82 | /* No comment provided by engineer. */ 83 | "Just now" = "Щойно"; 84 | 85 | /* No comment provided by engineer. */ 86 | "Last month" = "Місяць тому"; 87 | 88 | /* No comment provided by engineer. */ 89 | "Last week" = "Тиждень тому"; 90 | 91 | /* No comment provided by engineer. */ 92 | "Last year" = "Рік тому"; 93 | 94 | /* No comment provided by engineer. */ 95 | "Yesterday" = "Вчора"; 96 | 97 | /* No comment provided by engineer. */ 98 | "1 year ago" = "1 рік тому"; 99 | 100 | /* No comment provided by engineer. */ 101 | "1 month ago" = "1 місяць тому"; 102 | 103 | /* No comment provided by engineer. */ 104 | "1 week ago" = "1 тиждень тому"; 105 | 106 | /* No comment provided by engineer. */ 107 | "1 day ago" = "1 день тому"; 108 | 109 | /* No comment provided by engineer. */ 110 | "This morning" = "Цього ранку"; 111 | 112 | /* No comment provided by engineer. */ 113 | "This afternoon" = "Сьогодні вдень"; 114 | 115 | /* No comment provided by engineer. */ 116 | "Today" = "Сьогодні"; 117 | 118 | /* No comment provided by engineer. */ 119 | "This week" = "Цього тиждня"; 120 | 121 | /* No comment provided by engineer. */ 122 | "This month" = "Цього місяця"; 123 | 124 | /* No comment provided by engineer. */ 125 | "This year" = "Цього року"; 126 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/vi.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* No comment provided by engineer. */ 2 | "%d days ago" = "%d ngày trước"; 3 | 4 | /* No comment provided by engineer. */ 5 | "%d hours ago" = "%d giờ trước"; 6 | 7 | /* No comment provided by engineer. */ 8 | "%d minutes ago" = "%d phút trước"; 9 | 10 | /* No comment provided by engineer. */ 11 | "%d months ago" = "%d tháng trước"; 12 | 13 | /* No comment provided by engineer. */ 14 | "%d seconds ago" = "%d giây trước"; 15 | 16 | /* No comment provided by engineer. */ 17 | "%d weeks ago" = "%d tuần trước"; 18 | 19 | /* No comment provided by engineer. */ 20 | "%d years ago" = "%d năm trước"; 21 | 22 | /* No comment provided by engineer. */ 23 | "A minute ago" = "Một phút trước"; 24 | 25 | /* No comment provided by engineer. */ 26 | "An hour ago" = "Một giờ trước"; 27 | 28 | /* No comment provided by engineer. */ 29 | "Just now" = "Vừa mới đây"; 30 | 31 | /* No comment provided by engineer. */ 32 | "Last month" = "Tháng trước"; 33 | 34 | /* No comment provided by engineer. */ 35 | "Last week" = "Tuần trước"; 36 | 37 | /* No comment provided by engineer. */ 38 | "Last year" = "Năm vừa rồi"; 39 | 40 | /* No comment provided by engineer. */ 41 | "Yesterday" = "Hôm qua"; 42 | 43 | /* No comment provided by engineer. */ 44 | "1 year ago" = "1 năm trước"; 45 | 46 | /* No comment provided by engineer. */ 47 | "1 month ago" = "1 tháng trước"; 48 | 49 | /* No comment provided by engineer. */ 50 | "1 week ago" = "1 tuần trước"; 51 | 52 | /* No comment provided by engineer. */ 53 | "1 day ago" = "1 ngày trước"; 54 | 55 | /* No comment provided by engineer. */ 56 | "This morning" = "Sáng nay"; 57 | 58 | /* No comment provided by engineer. */ 59 | "This afternoon" = "Trưa nay"; 60 | 61 | /* No comment provided by engineer. */ 62 | "Today" = "Hôm nay"; 63 | 64 | /* No comment provided by engineer. */ 65 | "This week" = "Tuần này"; 66 | 67 | /* No comment provided by engineer. */ 68 | "This month" = "Tháng này"; 69 | 70 | /* No comment provided by engineer. */ 71 | "This year" = "Năm nay"; 72 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/zh-Hans.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* No comment provided by engineer. */ 2 | "%d days ago" = "%d天前"; 3 | 4 | /* No comment provided by engineer. */ 5 | "%d hours ago" = "%d小时前"; 6 | 7 | /* No comment provided by engineer. */ 8 | "%d minutes ago" = "%d分钟前"; 9 | 10 | /* No comment provided by engineer. */ 11 | "%d months ago" = "%d个月前"; 12 | 13 | /* No comment provided by engineer. */ 14 | "%d seconds ago" = "%d秒钟前"; 15 | 16 | /* No comment provided by engineer. */ 17 | "%d weeks ago" = "%d星期前"; 18 | 19 | /* No comment provided by engineer. */ 20 | "%d years ago" = "%d年前"; 21 | 22 | /* No comment provided by engineer. */ 23 | "A minute ago" = "1分钟前"; 24 | 25 | /* No comment provided by engineer. */ 26 | "An hour ago" = "1小时前"; 27 | 28 | /* No comment provided by engineer. */ 29 | "Just now" = "刚刚"; 30 | 31 | /* No comment provided by engineer. */ 32 | "Last month" = "上个月"; 33 | 34 | /* No comment provided by engineer. */ 35 | "Last week" = "上星期"; 36 | 37 | /* No comment provided by engineer. */ 38 | "Last year" = "去年"; 39 | 40 | /* No comment provided by engineer. */ 41 | "Yesterday" = "昨天"; 42 | 43 | /* You can add a space between the number and the characters. */ 44 | "1 year ago" = "1年前"; 45 | 46 | /* You can add a space between the number and the characters. */ 47 | "1 month ago" = "1个月前"; 48 | 49 | /* You can add a space between the number and the characters. */ 50 | "1 week ago" = "1星期前"; 51 | 52 | /* You can add a space between the number and the characters. */ 53 | "1 day ago" = "1天前"; 54 | 55 | /* No comment provided by engineer. */ 56 | "This morning" = "今天上午"; 57 | 58 | /* No comment provided by engineer. */ 59 | "This afternoon" = "今天下午"; 60 | 61 | /* No comment provided by engineer. */ 62 | "Today" = "今天"; 63 | 64 | /* No comment provided by engineer. */ 65 | "This week" = "本周"; 66 | 67 | /* No comment provided by engineer. */ 68 | "This month" = "本月"; 69 | 70 | /* No comment provided by engineer. */ 71 | "This year" = "今年"; 72 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/Vendor/NSDateTimeAgo.bundle/zh-Hant.lproj/NSDateTimeAgo.strings: -------------------------------------------------------------------------------- 1 | /* No comment provided by engineer. */ 2 | "%d days ago" = "%d天前"; 3 | 4 | /* No comment provided by engineer. */ 5 | "%d hours ago" = "%d小時前"; 6 | 7 | /* No comment provided by engineer. */ 8 | "%d minutes ago" = "%d分鐘前"; 9 | 10 | /* No comment provided by engineer. */ 11 | "%d months ago" = "%d個月前"; 12 | 13 | /* No comment provided by engineer. */ 14 | "%d seconds ago" = "%d秒鐘前"; 15 | 16 | /* No comment provided by engineer. */ 17 | "%d weeks ago" = "%d星期前"; 18 | 19 | /* No comment provided by engineer. */ 20 | "%d years ago" = "%d年前"; 21 | 22 | /* No comment provided by engineer. */ 23 | "A minute ago" = "1分鐘前"; 24 | 25 | /* No comment provided by engineer. */ 26 | "An hour ago" = "1小時前"; 27 | 28 | /* No comment provided by engineer. */ 29 | "Just now" = "剛剛"; 30 | 31 | /* No comment provided by engineer. */ 32 | "Last month" = "上個月"; 33 | 34 | /* No comment provided by engineer. */ 35 | "Last week" = "上星期"; 36 | 37 | /* No comment provided by engineer. */ 38 | "Last year" = "去年"; 39 | 40 | /* No comment provided by engineer. */ 41 | "Yesterday" = "昨天"; 42 | 43 | /* No comment provided by engineer. */ 44 | "1 year ago" = "1年前"; 45 | 46 | /* No comment provided by engineer. */ 47 | "1 month ago" = "1個月前"; 48 | 49 | /* No comment provided by engineer. */ 50 | "1 week ago" = "1星期前"; 51 | 52 | /* No comment provided by engineer. */ 53 | "1 day ago" = "1天前"; 54 | 55 | /* No comment provided by engineer. */ 56 | "This morning" = "今天上午"; 57 | 58 | /* No comment provided by engineer. */ 59 | "This afternoon" = "今天下午"; 60 | 61 | /* No comment provided by engineer. */ 62 | "Today" = "今天"; 63 | 64 | /* No comment provided by engineer. */ 65 | "This week" = "本周"; 66 | 67 | /* No comment provided by engineer. */ 68 | "This month" = "本月"; 69 | 70 | /* No comment provided by engineer. */ 71 | "This year" = "今年"; 72 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/XHRefreshControlExample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.HUAJIE.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/XHRefreshControlExample-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // XHRefreshControlExample 4 | // 5 | // Created by 曾 宪华 on 14-6-7. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExample/nothing_more_tips@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhzengAIB/XHRefreshControl/8cb5e6a237fa57df6d675f1eeb969d51882df560/XHRefreshControlExample/XHRefreshControlExample/nothing_more_tips@2x.png -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExampleTests/XHRefreshControlExampleTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.HUAJIE.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExampleTests/XHRefreshControlExampleTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHRefreshControlExampleTests.m 3 | // XHRefreshControlExampleTests 4 | // 5 | // Created by 曾 宪华 on 14-6-7. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XHRefreshControlExampleTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation XHRefreshControlExampleTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /XHRefreshControlExample/XHRefreshControlExampleTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | --------------------------------------------------------------------------------