├── .gitignore ├── CCBottomRefreshControl.podspec ├── Classes ├── UIScrollView+BottomRefreshControl.h └── UIScrollView+BottomRefreshControl.m ├── Example ├── BottomRefreshControlExample.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── BottomRefreshControlExample.xcworkspace │ └── contents.xcworkspacedata ├── BottomRefreshControlExample │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── Main.storyboard │ ├── BottomRefreshControlExample-Info.plist │ ├── BottomRefreshControlExample-Prefix.pch │ ├── CollectionViewController.h │ ├── CollectionViewController.m │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── LaunchScreen.xib │ ├── ScrollViewController.h │ ├── ScrollViewController.m │ ├── TableViewController.h │ ├── TableViewController.m │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m └── Podfile ├── LICENSE.txt ├── README.md └── example.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | */build/* 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | profile 14 | *.moved-aside 15 | DerivedData 16 | .idea/ 17 | *.hmap 18 | *.xccheckout 19 | 20 | #CocoaPods 21 | Pods 22 | Podfile.lock 23 | -------------------------------------------------------------------------------- /CCBottomRefreshControl.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "CCBottomRefreshControl" 3 | s.version = "0.5.2" 4 | s.summary = "A category for UIScrollView that implements an ability to add bottom aligned native iOS refresh control." 5 | s.description = "This category implements an additional property for UIScrollView class, that allows to add UIRefreshControl that aligned to bottom." 6 | s.homepage = "https://github.com/vlasov/CCBottomRefreshControl" 7 | s.license = { :type => 'MIT', :file => 'LICENSE.txt' } 8 | s.author = { "Nick Vlasov" => "vlasov1111@gmail.com" } 9 | s.source = { :git => "https://github.com/vlasov/CCBottomRefreshControl.git", :tag => s.version.to_s } 10 | s.platform = :ios, '7.0' 11 | s.source_files = "Classes/*" 12 | s.requires_arc = true 13 | s.framework = 'UIKit' 14 | end 15 | -------------------------------------------------------------------------------- /Classes/UIScrollView+BottomRefreshControl.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITableView+BottomRefreshControl.h 3 | // BottomRefreshControl 4 | // 5 | // Created by Nikolay Vlasov on 14.01.14. 6 | // Copyright (c) 2014 Nikolay Vlasov. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIScrollView (BottomRefreshControl) 12 | 13 | @property (nullable, nonatomic) UIRefreshControl *bottomRefreshControl; 14 | 15 | @end 16 | 17 | 18 | @interface UIRefreshControl (BottomRefreshControl) 19 | 20 | @property (nonatomic) CGFloat triggerVerticalOffset; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Classes/UIScrollView+BottomRefreshControl.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITableView+BottomRefreshControl.m 3 | // BottomRefreshControl 4 | // 5 | // Created by Nikolay Vlasov on 14.01.14. 6 | // Copyright (c) 2014 Nikolay Vlasov. All rights reserved. 7 | // 8 | 9 | #import "UIScrollView+BottomRefreshControl.h" 10 | 11 | #import 12 | #import 13 | 14 | 15 | @implementation NSObject (Swizzling) 16 | 17 | + (void)brc_swizzleMethod:(SEL)origSelector withMethod:(SEL)newSelector { 18 | 19 | Method origMethod = class_getInstanceMethod(self, origSelector); 20 | Method newMethod = class_getInstanceMethod(self, newSelector); 21 | 22 | if(class_addMethod(self, origSelector, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) 23 | class_replaceMethod(self, newSelector, method_getImplementation(origMethod), method_getTypeEncoding(origMethod)); 24 | else 25 | method_exchangeImplementations(origMethod, newMethod); 26 | } 27 | 28 | @end 29 | 30 | 31 | @implementation UIView (FindSubview) 32 | 33 | - (UIView *)brc_findFirstSubviewPassingTest:(BOOL (^)(UIView *subview))predicate { 34 | 35 | if (predicate(self)) 36 | return self; 37 | else 38 | for (UIView *subview in self.subviews) { 39 | 40 | UIView *result = [subview brc_findFirstSubviewPassingTest:predicate]; 41 | if (result) 42 | return result; 43 | } 44 | 45 | return 0; 46 | } 47 | 48 | @end 49 | 50 | 51 | NSString *const kRefrehControllerEndRefreshingNotification = @"RefrehControllerEndRefreshing"; 52 | 53 | const CGFloat kDefaultTriggerRefreshVerticalOffset = 120.; 54 | 55 | 56 | static char kBRCManualEndRefreshingKey; 57 | static char kTriggerVerticalOffsetKey; 58 | 59 | @implementation UIRefreshControl (BottomRefreshControl) 60 | 61 | + (void)load { 62 | 63 | [self brc_swizzleMethod:@selector(endRefreshing) withMethod:@selector(brc_endRefreshing)]; 64 | } 65 | 66 | 67 | - (void)brc_endRefreshing { 68 | 69 | if (self.brc_manualEndRefreshing) 70 | [[NSNotificationCenter defaultCenter] postNotificationName:kRefrehControllerEndRefreshingNotification object:self]; 71 | else 72 | [self brc_endRefreshing]; 73 | } 74 | 75 | - (void)setBrc_manualEndRefreshing:(BOOL)manual { 76 | 77 | objc_setAssociatedObject(self, &kBRCManualEndRefreshingKey, @(manual), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 78 | } 79 | 80 | - (BOOL)brc_manualEndRefreshing { 81 | 82 | NSNumber *manual = objc_getAssociatedObject(self, &kBRCManualEndRefreshingKey); 83 | return (manual) ? [manual boolValue] : NO; 84 | } 85 | 86 | - (void)setTriggerVerticalOffset:(CGFloat)offset { 87 | 88 | assert(offset > 0); 89 | objc_setAssociatedObject(self, &kTriggerVerticalOffsetKey, @(offset), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 90 | } 91 | 92 | - (CGFloat)triggerVerticalOffset { 93 | 94 | NSNumber *offset = objc_getAssociatedObject(self, &kTriggerVerticalOffsetKey); 95 | return (offset) ? [offset floatValue] : kDefaultTriggerRefreshVerticalOffset; 96 | } 97 | 98 | - (UILabel *)brc_titleLabel { 99 | 100 | return (UILabel *)[self brc_findFirstSubviewPassingTest:^BOOL(UIView *subview) { 101 | return ([subview isKindOfClass:[UILabel class]] && [((UILabel *)subview).attributedText isEqualToAttributedString:self.attributedTitle]); 102 | }]; 103 | } 104 | 105 | @end 106 | 107 | 108 | 109 | @interface BRCContext : NSObject 110 | 111 | @property (nonatomic) BOOL refreshed; 112 | @property (nonatomic) BOOL adjustBottomInset; 113 | @property (nonatomic) BOOL wasTracking; 114 | @property (nonatomic) NSDate *beginRefreshingDate; 115 | 116 | @property (nonatomic, weak) UITableView *fakeTableView; 117 | 118 | @end 119 | 120 | @implementation BRCContext 121 | 122 | @end 123 | 124 | 125 | 126 | 127 | 128 | static char kBottomRefreshControlKey; 129 | static char kBRCContextKey; 130 | 131 | const CGFloat kMinRefershTime = 0.5; 132 | 133 | 134 | @implementation UIScrollView (BottomRefreshControl) 135 | 136 | + (void)load { 137 | 138 | [self brc_swizzleMethod:@selector(didMoveToSuperview) withMethod:@selector(brc_didMoveToSuperview)]; 139 | [self brc_swizzleMethod:@selector(setContentInset:) withMethod:@selector(brc_setContentInset:)]; 140 | [self brc_swizzleMethod:@selector(contentInset) withMethod:@selector(brc_contentInset)]; 141 | [self brc_swizzleMethod:@selector(setContentOffset:) withMethod:@selector(brc_setContentOffset:)]; 142 | } 143 | 144 | - (void)brc_didMoveToSuperview { 145 | 146 | [self brc_didMoveToSuperview]; 147 | 148 | if (!self.brc_context) 149 | return; 150 | 151 | if (self.superview) 152 | [self brc_insertFakeTableView]; 153 | else 154 | [self.brc_context.fakeTableView removeFromSuperview]; 155 | } 156 | 157 | - (void)brc_setContentInset:(UIEdgeInsets)insets { 158 | 159 | if (self.brc_adjustBottomInset) 160 | insets.bottom += self.bottomRefreshControl.frame.size.height; 161 | 162 | [self brc_setContentInset:insets]; 163 | 164 | if (self.brc_adjustBottomInset) 165 | [self setNeedsUpdateConstraints]; 166 | } 167 | 168 | - (UIEdgeInsets)brc_contentInset { 169 | 170 | UIEdgeInsets insets = [self brc_contentInset]; 171 | 172 | if (self.brc_adjustBottomInset) 173 | insets.bottom -= self.bottomRefreshControl.frame.size.height; 174 | 175 | return insets; 176 | } 177 | 178 | - (void)brc_setContentOffset:(CGPoint)contentOffset { 179 | 180 | [self brc_setContentOffset:contentOffset]; 181 | 182 | if (!self.brc_context) 183 | return; 184 | 185 | if (self.brc_context.wasTracking && !self.tracking) 186 | [self didEndTracking]; 187 | 188 | self.brc_context.wasTracking = self.tracking; 189 | 190 | UIEdgeInsets contentInset = self.contentInset; 191 | CGFloat height = self.frame.size.height; 192 | 193 | CGFloat offset = (contentOffset.y + contentInset.top + height) - MAX((self.contentSize.height + contentInset.bottom + contentInset.top), height); 194 | 195 | if (offset > 0) 196 | [self handleBottomBounceOffset:offset]; 197 | else 198 | self.brc_context.refreshed = NO; 199 | } 200 | 201 | - (void)brc_checkRefreshingTimeAndPerformBlock:(void (^)())block { 202 | 203 | NSDate *date = self.brc_context.beginRefreshingDate; 204 | 205 | if (!date) 206 | block(); 207 | else { 208 | 209 | NSTimeInterval timeSinceLastRefresh = [[NSDate date] timeIntervalSinceDate:date]; 210 | if (timeSinceLastRefresh > kMinRefershTime) 211 | block(); 212 | else 213 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)((kMinRefershTime-timeSinceLastRefresh) * NSEC_PER_SEC)), dispatch_get_main_queue(), block); 214 | } 215 | } 216 | 217 | - (void)brc_insertFakeTableView { 218 | 219 | UITableView *tableView = self.brc_context.fakeTableView; 220 | 221 | [self.superview insertSubview:tableView aboveSubview:self]; 222 | 223 | NSLayoutConstraint *left = [NSLayoutConstraint constraintWithItem:tableView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0.0]; 224 | 225 | NSLayoutConstraint *right = [NSLayoutConstraint constraintWithItem:tableView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:0.0]; 226 | 227 | NSLayoutConstraint *bottom = [NSLayoutConstraint constraintWithItem:tableView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-self.contentInset.bottom]; 228 | 229 | NSLayoutConstraint *height = [NSLayoutConstraint constraintWithItem:tableView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute: NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:kDefaultTriggerRefreshVerticalOffset]; 230 | 231 | [tableView addConstraint:height]; 232 | [self.superview addConstraints:@[left, right, bottom]]; 233 | } 234 | 235 | - (void)updateConstraints { 236 | 237 | NSUInteger idx = [self.superview.constraints indexOfObjectPassingTest:^BOOL(__kindof NSLayoutConstraint * _Nonnull constraint, NSUInteger idx, BOOL * _Nonnull stop) { 238 | return (constraint.firstItem == self.brc_context.fakeTableView) && 239 | (constraint.secondItem == self) && 240 | (constraint.firstAttribute == NSLayoutAttributeBottom); 241 | }]; 242 | 243 | if (idx != NSNotFound) { 244 | NSLayoutConstraint *bottom = self.superview.constraints[idx]; 245 | bottom.constant = -self.contentInset.bottom; 246 | } 247 | 248 | [super updateConstraints]; 249 | } 250 | 251 | - (void)brc_SetAdjustBottomInset:(BOOL)adjust animated:(BOOL)animated { 252 | 253 | UIEdgeInsets contentInset = self.contentInset; 254 | self.brc_context.adjustBottomInset = adjust; 255 | 256 | if (animated) 257 | [UIView beginAnimations:0 context:0]; 258 | 259 | self.contentInset = contentInset; 260 | 261 | if (animated) 262 | [UIView commitAnimations]; 263 | } 264 | 265 | - (BOOL)brc_adjustBottomInset { 266 | 267 | return self.brc_context.adjustBottomInset; 268 | } 269 | 270 | - (void)setBottomRefreshControl:(UIRefreshControl *)refreshControl { 271 | 272 | if (self.bottomRefreshControl) { 273 | 274 | [[NSNotificationCenter defaultCenter] removeObserver:self name:kRefrehControllerEndRefreshingNotification object:self.bottomRefreshControl]; 275 | self.bottomRefreshControl.brc_manualEndRefreshing = NO; 276 | self.bottomRefreshControl.brc_titleLabel.transform = CGAffineTransformIdentity; 277 | 278 | [self.brc_context.fakeTableView removeFromSuperview]; 279 | 280 | self.brc_context = 0; 281 | } 282 | 283 | if (refreshControl) { 284 | 285 | BRCContext *context = [BRCContext new]; 286 | self.brc_context = context; 287 | 288 | UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; 289 | tableView.userInteractionEnabled = NO; 290 | tableView.translatesAutoresizingMaskIntoConstraints = NO; 291 | tableView.backgroundColor = [UIColor clearColor]; 292 | tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 293 | tableView.transform = CGAffineTransformMakeRotation(M_PI); 294 | 295 | refreshControl.brc_manualEndRefreshing = YES; 296 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(brc_didEndRefreshing) name:kRefrehControllerEndRefreshingNotification object:refreshControl]; 297 | 298 | refreshControl.brc_titleLabel.transform = CGAffineTransformMakeRotation(M_PI); 299 | 300 | 301 | [tableView addSubview:refreshControl]; 302 | 303 | context.fakeTableView = tableView; 304 | 305 | if (self.superview) 306 | [self brc_insertFakeTableView]; 307 | } 308 | 309 | [self willChangeValueForKey:@"bottomRefreshControl"]; 310 | objc_setAssociatedObject(self, &kBottomRefreshControlKey, refreshControl, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 311 | [self didChangeValueForKey:@"bottomRefreshControl"]; 312 | } 313 | 314 | - (UIRefreshControl *)bottomRefreshControl { 315 | 316 | return objc_getAssociatedObject(self, &kBottomRefreshControlKey); 317 | } 318 | 319 | - (void)setBrc_context:(BRCContext *)context { 320 | 321 | objc_setAssociatedObject(self, &kBRCContextKey, context, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 322 | } 323 | 324 | - (BRCContext *)brc_context { 325 | 326 | return objc_getAssociatedObject(self, &kBRCContextKey); 327 | } 328 | 329 | - (void)handleBottomBounceOffset:(CGFloat)offset { 330 | 331 | CGPoint contentOffset = self.brc_context.fakeTableView.contentOffset; 332 | CGFloat triggerOffset = self.bottomRefreshControl.triggerVerticalOffset; 333 | 334 | if (!self.brc_context.refreshed && (!self.decelerating || (contentOffset.y < 0))) { 335 | 336 | if (offset < triggerOffset) { 337 | 338 | contentOffset.y = -offset*kDefaultTriggerRefreshVerticalOffset/triggerOffset/1.5; 339 | self.brc_context.fakeTableView.contentOffset = contentOffset; 340 | 341 | } else if (!self.bottomRefreshControl.refreshing) 342 | [self brc_startRefresh]; 343 | } 344 | } 345 | 346 | - (void)brc_didEndRefreshing { 347 | 348 | [self brc_checkRefreshingTimeAndPerformBlock:^{ 349 | [self.bottomRefreshControl brc_endRefreshing]; 350 | [self brc_stopRefresh]; 351 | }]; 352 | } 353 | 354 | - (void)brc_startRefresh { 355 | 356 | self.brc_context.beginRefreshingDate = [NSDate date]; 357 | 358 | [self.bottomRefreshControl beginRefreshing]; 359 | [self.bottomRefreshControl sendActionsForControlEvents:UIControlEventValueChanged]; 360 | 361 | if (!self.tracking && !self.brc_adjustBottomInset) 362 | [self brc_SetAdjustBottomInset:YES animated:YES]; 363 | } 364 | 365 | - (void)brc_stopRefresh { 366 | 367 | self.brc_context.wasTracking = self.tracking; 368 | 369 | if (!self.tracking && self.brc_adjustBottomInset) { 370 | 371 | dispatch_async(dispatch_get_main_queue(), ^{ 372 | [self brc_SetAdjustBottomInset:NO animated:YES]; 373 | }); 374 | } 375 | 376 | self.brc_context.refreshed = self.tracking; 377 | } 378 | 379 | - (void)didEndTracking { 380 | 381 | if (self.bottomRefreshControl.refreshing && !self.brc_adjustBottomInset) 382 | [self brc_SetAdjustBottomInset:YES animated:YES]; 383 | 384 | if (self.brc_adjustBottomInset && !self.bottomRefreshControl.refreshing) 385 | [self brc_SetAdjustBottomInset:NO animated:YES]; 386 | } 387 | 388 | @end 389 | 390 | 391 | 392 | 393 | 394 | @implementation UITableView (BottomRefreshControl) 395 | 396 | + (void)load { 397 | 398 | [self brc_swizzleMethod:@selector(reloadData) withMethod:@selector(brc_reloadData)]; 399 | } 400 | 401 | - (void)brc_reloadData { 402 | 403 | if (!self.brc_context) 404 | [self brc_reloadData]; 405 | else 406 | [self brc_checkRefreshingTimeAndPerformBlock:^{ 407 | [self brc_reloadData]; 408 | }]; 409 | } 410 | 411 | @end 412 | 413 | 414 | 415 | 416 | 417 | @implementation UICollectionView (BottomRefreshControl) 418 | 419 | + (void)load { 420 | 421 | [self brc_swizzleMethod:@selector(reloadData) withMethod:@selector(brc_reloadData)]; 422 | } 423 | 424 | - (void)brc_reloadData { 425 | 426 | if (!self.brc_context) 427 | [self brc_reloadData]; 428 | else 429 | [self brc_checkRefreshingTimeAndPerformBlock:^{ 430 | [self brc_reloadData]; 431 | }]; 432 | } 433 | 434 | @end 435 | -------------------------------------------------------------------------------- /Example/BottomRefreshControlExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 72804F88244371D85A4F0AE5 /* libPods-BottomRefreshControlExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B15B8287C3D7BCA8EEA931B /* libPods-BottomRefreshControlExample.a */; }; 11 | BFC06A9956A14DBCA14923A4 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DC0021B9BAB042D9B496D785 /* libPods.a */; }; 12 | E97C967F1AB71B730072F3AB /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = E97C967E1AB71B730072F3AB /* LaunchScreen.xib */; }; 13 | E999D2281886C19A00E8953F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E999D2271886C19A00E8953F /* Foundation.framework */; }; 14 | E999D22A1886C19A00E8953F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E999D2291886C19A00E8953F /* CoreGraphics.framework */; }; 15 | E999D22C1886C19A00E8953F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E999D22B1886C19A00E8953F /* UIKit.framework */; }; 16 | E999D2321886C19A00E8953F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = E999D2301886C19A00E8953F /* InfoPlist.strings */; }; 17 | E999D2341886C19A00E8953F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E999D2331886C19A00E8953F /* main.m */; }; 18 | E999D2381886C19A00E8953F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E999D2371886C19A00E8953F /* AppDelegate.m */; }; 19 | E999D23B1886C19A00E8953F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E999D2391886C19A00E8953F /* Main.storyboard */; }; 20 | E999D23E1886C19A00E8953F /* TableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E999D23D1886C19A00E8953F /* TableViewController.m */; }; 21 | E999D2401886C19A00E8953F /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E999D23F1886C19A00E8953F /* Images.xcassets */; }; 22 | E9C8A8BF188AAEE400F8D3AB /* ScrollViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E9C8A8BE188AAEE400F8D3AB /* ScrollViewController.m */; }; 23 | E9C8A8C2188BF08600F8D3AB /* CollectionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E9C8A8C1188BF08600F8D3AB /* CollectionViewController.m */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 234561EDE73F115483ADDF28 /* Pods-BottomRefreshControlExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BottomRefreshControlExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-BottomRefreshControlExample/Pods-BottomRefreshControlExample.release.xcconfig"; sourceTree = ""; }; 28 | 260F94BF4059A7FFF9C6D12D /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; 29 | 4B15B8287C3D7BCA8EEA931B /* libPods-BottomRefreshControlExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-BottomRefreshControlExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | 5969A7CFA78903742E014BBA /* Pods-BottomRefreshControlExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BottomRefreshControlExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-BottomRefreshControlExample/Pods-BottomRefreshControlExample.debug.xcconfig"; sourceTree = ""; }; 31 | 6A6F73A64C496E42842C0DF6 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; 32 | DC0021B9BAB042D9B496D785 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | E97C967E1AB71B730072F3AB /* LaunchScreen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LaunchScreen.xib; sourceTree = ""; }; 34 | E999D2241886C19A00E8953F /* BottomRefreshControlExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BottomRefreshControlExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | E999D2271886C19A00E8953F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 36 | E999D2291886C19A00E8953F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 37 | E999D22B1886C19A00E8953F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 38 | E999D22F1886C19A00E8953F /* BottomRefreshControlExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BottomRefreshControlExample-Info.plist"; sourceTree = ""; }; 39 | E999D2311886C19A00E8953F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 40 | E999D2331886C19A00E8953F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 41 | E999D2351886C19A00E8953F /* BottomRefreshControlExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BottomRefreshControlExample-Prefix.pch"; sourceTree = ""; }; 42 | E999D2361886C19A00E8953F /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 43 | E999D2371886C19A00E8953F /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 44 | E999D23A1886C19A00E8953F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 45 | E999D23C1886C19A00E8953F /* TableViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TableViewController.h; sourceTree = ""; }; 46 | E999D23D1886C19A00E8953F /* TableViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TableViewController.m; sourceTree = ""; }; 47 | E999D23F1886C19A00E8953F /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 48 | E9C8A8BD188AAEE400F8D3AB /* ScrollViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollViewController.h; sourceTree = ""; }; 49 | E9C8A8BE188AAEE400F8D3AB /* ScrollViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = ScrollViewController.m; sourceTree = ""; }; 50 | E9C8A8C0188BF08600F8D3AB /* CollectionViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CollectionViewController.h; sourceTree = ""; }; 51 | E9C8A8C1188BF08600F8D3AB /* CollectionViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CollectionViewController.m; sourceTree = ""; }; 52 | /* End PBXFileReference section */ 53 | 54 | /* Begin PBXFrameworksBuildPhase section */ 55 | E999D2211886C19A00E8953F /* Frameworks */ = { 56 | isa = PBXFrameworksBuildPhase; 57 | buildActionMask = 2147483647; 58 | files = ( 59 | E999D22A1886C19A00E8953F /* CoreGraphics.framework in Frameworks */, 60 | E999D22C1886C19A00E8953F /* UIKit.framework in Frameworks */, 61 | E999D2281886C19A00E8953F /* Foundation.framework in Frameworks */, 62 | BFC06A9956A14DBCA14923A4 /* libPods.a in Frameworks */, 63 | 72804F88244371D85A4F0AE5 /* libPods-BottomRefreshControlExample.a in Frameworks */, 64 | ); 65 | runOnlyForDeploymentPostprocessing = 0; 66 | }; 67 | /* End PBXFrameworksBuildPhase section */ 68 | 69 | /* Begin PBXGroup section */ 70 | D068DB7827440E973606D278 /* Pods */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | 6A6F73A64C496E42842C0DF6 /* Pods.debug.xcconfig */, 74 | 260F94BF4059A7FFF9C6D12D /* Pods.release.xcconfig */, 75 | 5969A7CFA78903742E014BBA /* Pods-BottomRefreshControlExample.debug.xcconfig */, 76 | 234561EDE73F115483ADDF28 /* Pods-BottomRefreshControlExample.release.xcconfig */, 77 | ); 78 | name = Pods; 79 | sourceTree = ""; 80 | }; 81 | E999D21B1886C19A00E8953F = { 82 | isa = PBXGroup; 83 | children = ( 84 | E999D22D1886C19A00E8953F /* BottomRefreshControlExample */, 85 | E999D2261886C19A00E8953F /* Frameworks */, 86 | E999D2251886C19A00E8953F /* Products */, 87 | D068DB7827440E973606D278 /* Pods */, 88 | ); 89 | sourceTree = ""; 90 | }; 91 | E999D2251886C19A00E8953F /* Products */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | E999D2241886C19A00E8953F /* BottomRefreshControlExample.app */, 95 | ); 96 | name = Products; 97 | sourceTree = ""; 98 | }; 99 | E999D2261886C19A00E8953F /* Frameworks */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | E999D2271886C19A00E8953F /* Foundation.framework */, 103 | E999D2291886C19A00E8953F /* CoreGraphics.framework */, 104 | E999D22B1886C19A00E8953F /* UIKit.framework */, 105 | DC0021B9BAB042D9B496D785 /* libPods.a */, 106 | 4B15B8287C3D7BCA8EEA931B /* libPods-BottomRefreshControlExample.a */, 107 | ); 108 | name = Frameworks; 109 | sourceTree = ""; 110 | }; 111 | E999D22D1886C19A00E8953F /* BottomRefreshControlExample */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | E999D23F1886C19A00E8953F /* Images.xcassets */, 115 | E999D2361886C19A00E8953F /* AppDelegate.h */, 116 | E999D2371886C19A00E8953F /* AppDelegate.m */, 117 | E9C8A8BD188AAEE400F8D3AB /* ScrollViewController.h */, 118 | E9C8A8BE188AAEE400F8D3AB /* ScrollViewController.m */, 119 | E999D23C1886C19A00E8953F /* TableViewController.h */, 120 | E999D23D1886C19A00E8953F /* TableViewController.m */, 121 | E9C8A8C0188BF08600F8D3AB /* CollectionViewController.h */, 122 | E9C8A8C1188BF08600F8D3AB /* CollectionViewController.m */, 123 | E999D22E1886C19A00E8953F /* Supporting Files */, 124 | ); 125 | path = BottomRefreshControlExample; 126 | sourceTree = ""; 127 | }; 128 | E999D22E1886C19A00E8953F /* Supporting Files */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | E999D2391886C19A00E8953F /* Main.storyboard */, 132 | E97C967E1AB71B730072F3AB /* LaunchScreen.xib */, 133 | E999D22F1886C19A00E8953F /* BottomRefreshControlExample-Info.plist */, 134 | E999D2301886C19A00E8953F /* InfoPlist.strings */, 135 | E999D2331886C19A00E8953F /* main.m */, 136 | E999D2351886C19A00E8953F /* BottomRefreshControlExample-Prefix.pch */, 137 | ); 138 | name = "Supporting Files"; 139 | sourceTree = ""; 140 | }; 141 | /* End PBXGroup section */ 142 | 143 | /* Begin PBXNativeTarget section */ 144 | E999D2231886C19A00E8953F /* BottomRefreshControlExample */ = { 145 | isa = PBXNativeTarget; 146 | buildConfigurationList = E999D2561886C19A00E8953F /* Build configuration list for PBXNativeTarget "BottomRefreshControlExample" */; 147 | buildPhases = ( 148 | 55397B9777C94E0197AC973E /* [CP] Check Pods Manifest.lock */, 149 | E999D2201886C19A00E8953F /* Sources */, 150 | E999D2211886C19A00E8953F /* Frameworks */, 151 | E999D2221886C19A00E8953F /* Resources */, 152 | B7559DB8D6E44C3EBE078BF4 /* [CP] Copy Pods Resources */, 153 | 9EDAFA825742253243B36E04 /* [CP] Embed Pods Frameworks */, 154 | ); 155 | buildRules = ( 156 | ); 157 | dependencies = ( 158 | ); 159 | name = BottomRefreshControlExample; 160 | productName = BottomRefreshControlExample; 161 | productReference = E999D2241886C19A00E8953F /* BottomRefreshControlExample.app */; 162 | productType = "com.apple.product-type.application"; 163 | }; 164 | /* End PBXNativeTarget section */ 165 | 166 | /* Begin PBXProject section */ 167 | E999D21C1886C19A00E8953F /* Project object */ = { 168 | isa = PBXProject; 169 | attributes = { 170 | LastUpgradeCheck = 0620; 171 | ORGANIZATIONNAME = nickvlasov; 172 | }; 173 | buildConfigurationList = E999D21F1886C19A00E8953F /* Build configuration list for PBXProject "BottomRefreshControlExample" */; 174 | compatibilityVersion = "Xcode 3.2"; 175 | developmentRegion = English; 176 | hasScannedForEncodings = 0; 177 | knownRegions = ( 178 | en, 179 | Base, 180 | ); 181 | mainGroup = E999D21B1886C19A00E8953F; 182 | productRefGroup = E999D2251886C19A00E8953F /* Products */; 183 | projectDirPath = ""; 184 | projectRoot = ""; 185 | targets = ( 186 | E999D2231886C19A00E8953F /* BottomRefreshControlExample */, 187 | ); 188 | }; 189 | /* End PBXProject section */ 190 | 191 | /* Begin PBXResourcesBuildPhase section */ 192 | E999D2221886C19A00E8953F /* Resources */ = { 193 | isa = PBXResourcesBuildPhase; 194 | buildActionMask = 2147483647; 195 | files = ( 196 | E97C967F1AB71B730072F3AB /* LaunchScreen.xib in Resources */, 197 | E999D2401886C19A00E8953F /* Images.xcassets in Resources */, 198 | E999D2321886C19A00E8953F /* InfoPlist.strings in Resources */, 199 | E999D23B1886C19A00E8953F /* Main.storyboard in Resources */, 200 | ); 201 | runOnlyForDeploymentPostprocessing = 0; 202 | }; 203 | /* End PBXResourcesBuildPhase section */ 204 | 205 | /* Begin PBXShellScriptBuildPhase section */ 206 | 55397B9777C94E0197AC973E /* [CP] Check Pods Manifest.lock */ = { 207 | isa = PBXShellScriptBuildPhase; 208 | buildActionMask = 2147483647; 209 | files = ( 210 | ); 211 | inputPaths = ( 212 | ); 213 | name = "[CP] Check Pods Manifest.lock"; 214 | outputPaths = ( 215 | ); 216 | runOnlyForDeploymentPostprocessing = 0; 217 | shellPath = /bin/sh; 218 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; 219 | showEnvVarsInLog = 0; 220 | }; 221 | 9EDAFA825742253243B36E04 /* [CP] Embed Pods Frameworks */ = { 222 | isa = PBXShellScriptBuildPhase; 223 | buildActionMask = 2147483647; 224 | files = ( 225 | ); 226 | inputPaths = ( 227 | ); 228 | name = "[CP] Embed Pods Frameworks"; 229 | outputPaths = ( 230 | ); 231 | runOnlyForDeploymentPostprocessing = 0; 232 | shellPath = /bin/sh; 233 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-BottomRefreshControlExample/Pods-BottomRefreshControlExample-frameworks.sh\"\n"; 234 | showEnvVarsInLog = 0; 235 | }; 236 | B7559DB8D6E44C3EBE078BF4 /* [CP] Copy Pods Resources */ = { 237 | isa = PBXShellScriptBuildPhase; 238 | buildActionMask = 2147483647; 239 | files = ( 240 | ); 241 | inputPaths = ( 242 | ); 243 | name = "[CP] Copy Pods Resources"; 244 | outputPaths = ( 245 | ); 246 | runOnlyForDeploymentPostprocessing = 0; 247 | shellPath = /bin/sh; 248 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-BottomRefreshControlExample/Pods-BottomRefreshControlExample-resources.sh\"\n"; 249 | showEnvVarsInLog = 0; 250 | }; 251 | /* End PBXShellScriptBuildPhase section */ 252 | 253 | /* Begin PBXSourcesBuildPhase section */ 254 | E999D2201886C19A00E8953F /* Sources */ = { 255 | isa = PBXSourcesBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | E9C8A8BF188AAEE400F8D3AB /* ScrollViewController.m in Sources */, 259 | E999D23E1886C19A00E8953F /* TableViewController.m in Sources */, 260 | E9C8A8C2188BF08600F8D3AB /* CollectionViewController.m in Sources */, 261 | E999D2381886C19A00E8953F /* AppDelegate.m in Sources */, 262 | E999D2341886C19A00E8953F /* main.m in Sources */, 263 | ); 264 | runOnlyForDeploymentPostprocessing = 0; 265 | }; 266 | /* End PBXSourcesBuildPhase section */ 267 | 268 | /* Begin PBXVariantGroup section */ 269 | E999D2301886C19A00E8953F /* InfoPlist.strings */ = { 270 | isa = PBXVariantGroup; 271 | children = ( 272 | E999D2311886C19A00E8953F /* en */, 273 | ); 274 | name = InfoPlist.strings; 275 | sourceTree = ""; 276 | }; 277 | E999D2391886C19A00E8953F /* Main.storyboard */ = { 278 | isa = PBXVariantGroup; 279 | children = ( 280 | E999D23A1886C19A00E8953F /* Base */, 281 | ); 282 | name = Main.storyboard; 283 | sourceTree = ""; 284 | }; 285 | /* End PBXVariantGroup section */ 286 | 287 | /* Begin XCBuildConfiguration section */ 288 | E999D2541886C19A00E8953F /* Debug */ = { 289 | isa = XCBuildConfiguration; 290 | buildSettings = { 291 | ALWAYS_SEARCH_USER_PATHS = NO; 292 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 293 | CLANG_CXX_LIBRARY = "libc++"; 294 | CLANG_ENABLE_MODULES = YES; 295 | CLANG_ENABLE_OBJC_ARC = YES; 296 | CLANG_WARN_BOOL_CONVERSION = YES; 297 | CLANG_WARN_CONSTANT_CONVERSION = YES; 298 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 299 | CLANG_WARN_EMPTY_BODY = YES; 300 | CLANG_WARN_ENUM_CONVERSION = YES; 301 | CLANG_WARN_INT_CONVERSION = YES; 302 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 303 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 304 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 305 | COPY_PHASE_STRIP = NO; 306 | GCC_C_LANGUAGE_STANDARD = gnu99; 307 | GCC_DYNAMIC_NO_PIC = NO; 308 | GCC_OPTIMIZATION_LEVEL = 0; 309 | GCC_PREPROCESSOR_DEFINITIONS = ( 310 | "DEBUG=1", 311 | "$(inherited)", 312 | ); 313 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 314 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 315 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 316 | GCC_WARN_UNDECLARED_SELECTOR = YES; 317 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 318 | GCC_WARN_UNUSED_FUNCTION = YES; 319 | GCC_WARN_UNUSED_VARIABLE = YES; 320 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 321 | ONLY_ACTIVE_ARCH = YES; 322 | SDKROOT = iphoneos; 323 | }; 324 | name = Debug; 325 | }; 326 | E999D2551886C19A00E8953F /* Release */ = { 327 | isa = XCBuildConfiguration; 328 | buildSettings = { 329 | ALWAYS_SEARCH_USER_PATHS = NO; 330 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 331 | CLANG_CXX_LIBRARY = "libc++"; 332 | CLANG_ENABLE_MODULES = YES; 333 | CLANG_ENABLE_OBJC_ARC = YES; 334 | CLANG_WARN_BOOL_CONVERSION = YES; 335 | CLANG_WARN_CONSTANT_CONVERSION = YES; 336 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 337 | CLANG_WARN_EMPTY_BODY = YES; 338 | CLANG_WARN_ENUM_CONVERSION = YES; 339 | CLANG_WARN_INT_CONVERSION = YES; 340 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 341 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 342 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 343 | COPY_PHASE_STRIP = YES; 344 | ENABLE_NS_ASSERTIONS = NO; 345 | GCC_C_LANGUAGE_STANDARD = gnu99; 346 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 347 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 348 | GCC_WARN_UNDECLARED_SELECTOR = YES; 349 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 350 | GCC_WARN_UNUSED_FUNCTION = YES; 351 | GCC_WARN_UNUSED_VARIABLE = YES; 352 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 353 | SDKROOT = iphoneos; 354 | VALIDATE_PRODUCT = YES; 355 | }; 356 | name = Release; 357 | }; 358 | E999D2571886C19A00E8953F /* Debug */ = { 359 | isa = XCBuildConfiguration; 360 | baseConfigurationReference = 5969A7CFA78903742E014BBA /* Pods-BottomRefreshControlExample.debug.xcconfig */; 361 | buildSettings = { 362 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 363 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 364 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 365 | GCC_PREFIX_HEADER = "BottomRefreshControlExample/BottomRefreshControlExample-Prefix.pch"; 366 | INFOPLIST_FILE = "BottomRefreshControlExample/BottomRefreshControlExample-Info.plist"; 367 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 368 | PRODUCT_NAME = "$(TARGET_NAME)"; 369 | WRAPPER_EXTENSION = app; 370 | }; 371 | name = Debug; 372 | }; 373 | E999D2581886C19A00E8953F /* Release */ = { 374 | isa = XCBuildConfiguration; 375 | baseConfigurationReference = 234561EDE73F115483ADDF28 /* Pods-BottomRefreshControlExample.release.xcconfig */; 376 | buildSettings = { 377 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 378 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 379 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 380 | GCC_PREFIX_HEADER = "BottomRefreshControlExample/BottomRefreshControlExample-Prefix.pch"; 381 | INFOPLIST_FILE = "BottomRefreshControlExample/BottomRefreshControlExample-Info.plist"; 382 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 383 | PRODUCT_NAME = "$(TARGET_NAME)"; 384 | WRAPPER_EXTENSION = app; 385 | }; 386 | name = Release; 387 | }; 388 | /* End XCBuildConfiguration section */ 389 | 390 | /* Begin XCConfigurationList section */ 391 | E999D21F1886C19A00E8953F /* Build configuration list for PBXProject "BottomRefreshControlExample" */ = { 392 | isa = XCConfigurationList; 393 | buildConfigurations = ( 394 | E999D2541886C19A00E8953F /* Debug */, 395 | E999D2551886C19A00E8953F /* Release */, 396 | ); 397 | defaultConfigurationIsVisible = 0; 398 | defaultConfigurationName = Release; 399 | }; 400 | E999D2561886C19A00E8953F /* Build configuration list for PBXNativeTarget "BottomRefreshControlExample" */ = { 401 | isa = XCConfigurationList; 402 | buildConfigurations = ( 403 | E999D2571886C19A00E8953F /* Debug */, 404 | E999D2581886C19A00E8953F /* Release */, 405 | ); 406 | defaultConfigurationIsVisible = 0; 407 | defaultConfigurationName = Release; 408 | }; 409 | /* End XCConfigurationList section */ 410 | }; 411 | rootObject = E999D21C1886C19A00E8953F /* Project object */; 412 | } 413 | -------------------------------------------------------------------------------- /Example/BottomRefreshControlExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/BottomRefreshControlExample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/BottomRefreshControlExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // BottomRefreshControlExample 4 | // 5 | // Created by Nikolay Vlasov on 15.01.14. 6 | // Copyright (c) 2014 Nikolay Vlasov. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/BottomRefreshControlExample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // BottomRefreshControlExample 4 | // 5 | // Created by Nikolay Vlasov on 15.01.14. 6 | // Copyright (c) 2014 Nikolay Vlasov. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // 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. 22 | // 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. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // 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. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // 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. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Example/BottomRefreshControlExample/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | -------------------------------------------------------------------------------- /Example/BottomRefreshControlExample/BottomRefreshControlExample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.nickvlasov.${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 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Example/BottomRefreshControlExample/BottomRefreshControlExample-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 | #import 17 | #import 18 | #endif 19 | -------------------------------------------------------------------------------- /Example/BottomRefreshControlExample/CollectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CollectionViewController.h 3 | // BottomRefreshControlExample 4 | // 5 | // Created by Nikolay Vlasov on 19.01.14. 6 | // Copyright (c) 2014 nickvlasov. All rights reserved. 7 | // 8 | 9 | #import "ScrollViewController.h" 10 | 11 | @interface CollectionViewController : ScrollViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/BottomRefreshControlExample/CollectionViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CollectionViewController.m 3 | // BottomRefreshControlExample 4 | // 5 | // Created by Nikolay Vlasov on 19.01.14. 6 | // Copyright (c) 2014 nickvlasov. All rights reserved. 7 | // 8 | 9 | #import "CollectionViewController.h" 10 | 11 | @interface CollectionViewController () 12 | 13 | @property (nonatomic, weak) IBOutlet UICollectionView *collectionView; 14 | - (IBAction)dismissPressed; 15 | 16 | @end 17 | 18 | @implementation CollectionViewController 19 | 20 | - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { 21 | 22 | return self.numberOfItems; 23 | } 24 | 25 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { 26 | 27 | UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"MyCollectionCell" forIndexPath:indexPath]; 28 | cell.contentView.backgroundColor = [UIColor lightGrayColor]; 29 | 30 | return cell; 31 | } 32 | 33 | - (void)reloadData { 34 | 35 | [self.collectionView reloadData]; 36 | } 37 | 38 | - (IBAction)dismissPressed { 39 | 40 | [self dismissViewControllerAnimated:YES completion:0]; 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Example/BottomRefreshControlExample/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" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/BottomRefreshControlExample/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 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/BottomRefreshControlExample/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Example/BottomRefreshControlExample/ScrollViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ScrollViewController.h 3 | // BottomRefreshControlExample 4 | // 5 | // Created by Nikolay Vlasov on 18.01.14. 6 | // Copyright (c) 2014 nickvlasov. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ScrollViewController : UIViewController 12 | 13 | @property (nonatomic, weak) IBOutlet UIScrollView *scrollView; 14 | @property (nonatomic, strong) UIRefreshControl *topRefreshControl; 15 | 16 | @property (nonatomic) NSInteger numberOfItems; 17 | 18 | - (void)reloadData; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Example/BottomRefreshControlExample/ScrollViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ScrollViewController.m 3 | // BottomRefreshControlExample 4 | // 5 | // Created by Nikolay Vlasov on 18.01.14. 6 | // Copyright (c) 2014 nickvlasov. All rights reserved. 7 | // 8 | 9 | #import "ScrollViewController.h" 10 | 11 | 12 | @implementation ScrollViewController 13 | 14 | - (void)viewDidLoad { 15 | 16 | [super viewDidLoad]; 17 | 18 | self.numberOfItems = 20; 19 | 20 | self.topRefreshControl = [UIRefreshControl new]; 21 | self.topRefreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull down to reload!"]; 22 | [self.topRefreshControl addTarget:self action:@selector(refreshTop) forControlEvents:UIControlEventValueChanged]; 23 | [self.scrollView addSubview:self.topRefreshControl]; 24 | 25 | UIRefreshControl *refreshControl = [UIRefreshControl new]; 26 | refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull up to reload!"]; 27 | refreshControl.triggerVerticalOffset = 80.; 28 | [refreshControl addTarget:self action:@selector(refreshBottom) forControlEvents:UIControlEventValueChanged]; 29 | self.scrollView.bottomRefreshControl = refreshControl; 30 | } 31 | 32 | - (void)dealloc { 33 | 34 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 35 | } 36 | 37 | - (void)viewWillAppear:(BOOL)animated { 38 | 39 | [super viewWillAppear:animated]; 40 | 41 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:0]; 42 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:0]; 43 | } 44 | 45 | - (void)viewWillDisappear:(BOOL)animated { 46 | 47 | [super viewWillDisappear:animated]; 48 | 49 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 50 | } 51 | 52 | - (void)refreshTop { 53 | 54 | double delayInSeconds = 1.0; 55 | dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); 56 | dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ 57 | 58 | self.numberOfItems = MAX(0, self.numberOfItems-5); 59 | [self reloadData]; 60 | [self.topRefreshControl endRefreshing]; 61 | }); 62 | } 63 | 64 | - (void)refreshBottom { 65 | 66 | double delayInSeconds = 1.0; 67 | dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); 68 | dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ 69 | 70 | self.numberOfItems += 5; 71 | [self reloadData]; 72 | [self.scrollView.bottomRefreshControl endRefreshing]; 73 | }); 74 | } 75 | 76 | - (void)reloadData { 77 | 78 | } 79 | 80 | 81 | - (void)keyboardWillShow:(NSNotification *)notification { 82 | 83 | NSDictionary *userInfo = [notification userInfo]; 84 | 85 | NSTimeInterval duration = [userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue]; 86 | CGRect frameEnd = [userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue]; 87 | 88 | [UIView animateWithDuration:duration animations:^{ 89 | 90 | self.scrollView.contentInsetBottom = MAX(0., self.scrollView.maxY-frameEnd.origin.y); 91 | self.scrollView.scrollIndicatorInsets = self.scrollView.contentInset; 92 | }]; 93 | } 94 | 95 | 96 | - (void)keyboardWillHide:(NSNotification *)notification { 97 | 98 | NSDictionary *userInfo = [notification userInfo]; 99 | 100 | NSTimeInterval duration = [userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue]; 101 | 102 | [UIView animateWithDuration:duration animations:^{ 103 | 104 | self.scrollView.contentInsetBottom = 0; 105 | self.scrollView.scrollIndicatorInsets = self.scrollView.contentInset; 106 | }]; 107 | } 108 | 109 | 110 | 111 | @end 112 | -------------------------------------------------------------------------------- /Example/BottomRefreshControlExample/TableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // BottomRefreshControlExample 4 | // 5 | // Created by Nikolay Vlasov on 15.01.14. 6 | // Copyright (c) 2014 Nikolay Vlasov. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ScrollViewController.h" 11 | 12 | @interface TableViewController : ScrollViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Example/BottomRefreshControlExample/TableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // BottomRefreshControlExample 4 | // 5 | // Created by Nikolay Vlasov on 15.01.14. 6 | // Copyright (c) 2014 Nikolay Vlasov. All rights reserved. 7 | // 8 | 9 | #import "TableViewController.h" 10 | #import "UIScrollView+BottomRefreshControl.h" 11 | 12 | @interface TableViewController () 13 | 14 | @property (nonatomic, weak) IBOutlet UITableView *tableView; 15 | 16 | @end 17 | 18 | 19 | @implementation TableViewController 20 | 21 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 22 | 23 | return self.numberOfItems; 24 | } 25 | 26 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 27 | 28 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyTableCell" forIndexPath:indexPath]; 29 | cell.contentView.backgroundColor = (indexPath.row % 2 == 0) ? [UIColor lightGrayColor] : [UIColor whiteColor]; 30 | 31 | return cell; 32 | } 33 | 34 | - (void)reloadData { 35 | 36 | [self.tableView reloadData]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Example/BottomRefreshControlExample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/BottomRefreshControlExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // BottomRefreshControlExample 4 | // 5 | // Created by Nikolay Vlasov on 15.01.14. 6 | // Copyright (c) 2014 nickvlasov. 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 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | platform :ios, '7.0' 3 | target 'BottomRefreshControlExample' 4 | 5 | pod 'CCBottomRefreshControl', :path => '../' 6 | pod 'UIView+TKGeometry' 7 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Nikolay Vlasov 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | CCBottomRefreshControl 2 | ====================== 3 | 4 | Category for `UIScrollView` class, that adds `bottomRefreshControl` property, that could be assigned to `UIRefreshControl` class instance. It implements an ability to add native iOS bottom pull-up to refresh control to `UITableView` or `UICollectionView`. Perfectly works with top top refresh control (see example project). 5 | Very useful for refreshing table and collection views that contain most recent items at the bottom. For example in chats. 6 | 7 | 8 | 9 | ![](example.png) 10 | 11 | 12 | ## Installation 13 | 14 | [CocoaPods](http://cocoapods.org) is the recommended way to add `CCBottomRefreshControl` to your project. 15 | 16 | Here's an example **podfile** that installs `CCBottomRefreshControl`. 17 | 18 | ### Podfile 19 | 20 | ```ruby 21 | platform :ios, '7.0' 22 | 23 | pod 'CCBottomRefreshControl' 24 | ``` 25 | 26 | 27 | ## Usage 28 | 29 | Create an ordinary `UIRefreshControl` class instance, and assign additional `UITableView/UICollectionView` property `bottomRefreshControl` to it. 30 | 31 | Additional `triggerVerticalOffset` property in `UIRefreshControl` class allows you to specify a vertical offset, after reaching which refresh will be triggered. Default value is 120. 32 | 33 | 34 | ```objective-c 35 | #import 36 | 37 | ... 38 | 39 | UIRefreshControl *refreshControl = [UIRefreshControl new]; 40 | refreshControl.triggerVerticalOffset = 100.; 41 | [refreshControl addTarget:self action:@selector(refresh) forControlEvents:UIControlEventValueChanged]; 42 | self.tableView.bottomRefreshControl = refreshControl; 43 | 44 | - (void)refresh { 45 | // Do refresh stuff here 46 | } 47 | ``` 48 | 49 | ## License 50 | 51 | CCBottomRefreshControl is released under the MIT license. See [LICENSE](LICENSE.txt) 52 | -------------------------------------------------------------------------------- /example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlasov/CCBottomRefreshControl/bd9580fae482738e9b8610da35617932e17705fc/example.png --------------------------------------------------------------------------------