├── .gitignore ├── Demo └── TableViewPull │ ├── Classes │ ├── Controller │ │ └── RootViewController │ │ │ ├── RootViewController.h │ │ │ └── RootViewController.m │ ├── Delegate │ │ ├── TableViewPullAppDelegate.h │ │ └── TableViewPullAppDelegate.m │ └── View │ │ └── LoadMoreTableFooterView │ │ ├── LoadMoreTableFooterView.h │ │ └── LoadMoreTableFooterView.m │ ├── Resources │ ├── MainWindow.xib │ ├── RootViewController.xib │ └── TableViewPull-Info.plist │ ├── TableViewPull.xcodeproj │ └── project.pbxproj │ ├── TableViewPull_Prefix.pch │ └── main.m ├── LoadMoreTableFooterView └── Classes │ ├── LoadMoreTableFooterView.h │ └── LoadMoreTableFooterView.m └── README /.gitignore: -------------------------------------------------------------------------------- 1 | *.build 2 | build 3 | .DS_Store 4 | *.pbxuser 5 | *.mode1v3 6 | -------------------------------------------------------------------------------- /Demo/TableViewPull/Classes/Controller/RootViewController/RootViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RootViewController.h 3 | // TableViewPull 4 | // 5 | // Created by Devin Doty on 10/16/09 October16. 6 | // Modified by Ye Dingding on 10-12-24. 7 | // Copyright Intridea, Inc 2010. All rights reserved. 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | // 27 | 28 | 29 | #import "LoadMoreTableFooterView.h" 30 | 31 | @interface RootViewController : UITableViewController { 32 | 33 | LoadMoreTableFooterView *_loadMoreFooterView; 34 | 35 | // Reloading var should really be your tableviews datasource 36 | // Putting it here for demo purposes 37 | BOOL _reloading; 38 | } 39 | 40 | - (void)reloadTableViewDataSource; 41 | - (void)doneLoadingTableViewData; 42 | @end 43 | -------------------------------------------------------------------------------- /Demo/TableViewPull/Classes/Controller/RootViewController/RootViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RootViewController.m 3 | // TableViewPull 4 | // 5 | // Created by Devin Doty on 10/16/09October16. 6 | // Created by Ye Dingding on 10-12-24. 7 | // Copyright Intridea, Inc 2010. All rights reserved. 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | // THE SOFTWARE. 26 | // 27 | 28 | #import "RootViewController.h" 29 | 30 | @implementation RootViewController 31 | 32 | - (void)viewDidLoad { 33 | [super viewDidLoad]; 34 | 35 | if (_loadMoreFooterView == nil) { 36 | LoadMoreTableFooterView *view = [[LoadMoreTableFooterView alloc] initWithFrame:CGRectMake(0.0f, self.tableView.contentSize.height, self.tableView.frame.size.width, self.tableView.bounds.size.height)]; 37 | view.delegate = self; 38 | [self.tableView addSubview:view]; 39 | _loadMoreFooterView = view; 40 | [view release]; 41 | 42 | } 43 | } 44 | 45 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 46 | return YES; 47 | } 48 | 49 | 50 | #pragma mark - 51 | #pragma mark UITableViewDataSource 52 | 53 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 54 | return 10; 55 | } 56 | 57 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 58 | return 4; 59 | } 60 | 61 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 62 | 63 | static NSString *CellIdentifier = @"Cell"; 64 | 65 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 66 | if (cell == nil) { 67 | cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; 68 | } 69 | 70 | // Configure the cell. 71 | 72 | return cell; 73 | } 74 | 75 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{ 76 | 77 | return [NSString stringWithFormat:@"Section %i", section]; 78 | 79 | } 80 | 81 | 82 | #pragma mark - 83 | #pragma mark Data Source Loading / Reloading Methods 84 | 85 | - (void)reloadTableViewDataSource{ 86 | 87 | // should be calling your tableviews data source model to reload 88 | // put here just for demo 89 | _reloading = YES; 90 | 91 | } 92 | 93 | - (void)doneLoadingTableViewData{ 94 | 95 | // model should call this when its done loading 96 | _reloading = NO; 97 | [_loadMoreFooterView loadMoreScrollViewDataSourceDidFinishedLoading:self.tableView]; 98 | } 99 | 100 | 101 | #pragma mark - 102 | #pragma mark UIScrollViewDelegate Methods 103 | 104 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView{ 105 | 106 | [_loadMoreFooterView loadMoreScrollViewDidScroll:scrollView]; 107 | 108 | } 109 | 110 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{ 111 | 112 | [_loadMoreFooterView loadMoreScrollViewDidEndDragging:scrollView]; 113 | 114 | } 115 | 116 | 117 | #pragma mark - 118 | #pragma mark LoadMoreTableFooterDelegate Methods 119 | 120 | - (void)loadMoreTableFooterDidTriggerRefresh:(LoadMoreTableFooterView *)view { 121 | 122 | [self reloadTableViewDataSource]; 123 | [self performSelector:@selector(doneLoadingTableViewData) withObject:nil afterDelay:3.0]; 124 | 125 | } 126 | 127 | - (BOOL)loadMoreTableFooterDataSourceIsLoading:(LoadMoreTableFooterView *)view { 128 | return _reloading; 129 | } 130 | 131 | #pragma mark - 132 | #pragma mark Memory Management 133 | 134 | - (void)didReceiveMemoryWarning { 135 | [super didReceiveMemoryWarning]; 136 | } 137 | 138 | - (void)viewDidUnload { 139 | _loadMoreFooterView=nil; 140 | } 141 | 142 | - (void)dealloc { 143 | 144 | _loadMoreFooterView = nil; 145 | [super dealloc]; 146 | } 147 | 148 | 149 | @end 150 | 151 | -------------------------------------------------------------------------------- /Demo/TableViewPull/Classes/Delegate/TableViewPullAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // TableViewPullAppDelegate.h 3 | // TableViewPull 4 | // 5 | // Created by Devin Doty on 10/16/09October16. 6 | // Copyright enormego 2009. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | @interface TableViewPullAppDelegate : NSObject { 28 | 29 | UIWindow *window; 30 | UINavigationController *navigationController; 31 | } 32 | 33 | @property (nonatomic, retain) IBOutlet UIWindow *window; 34 | @property (nonatomic, retain) IBOutlet UINavigationController *navigationController; 35 | 36 | @end 37 | 38 | -------------------------------------------------------------------------------- /Demo/TableViewPull/Classes/Delegate/TableViewPullAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // TableViewPullAppDelegate.m 3 | // TableViewPull 4 | // 5 | // Created by Devin Doty on 10/16/09October16. 6 | // Copyright enormego 2009. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import "TableViewPullAppDelegate.h" 28 | #import "RootViewController.h" 29 | 30 | 31 | @implementation TableViewPullAppDelegate 32 | 33 | @synthesize window; 34 | @synthesize navigationController; 35 | 36 | 37 | #pragma mark - 38 | #pragma mark Application lifecycle 39 | 40 | - (void)applicationDidFinishLaunching:(UIApplication *)application { 41 | 42 | // Override point for customization after app launch 43 | 44 | [window addSubview:[navigationController view]]; 45 | [window makeKeyAndVisible]; 46 | } 47 | 48 | 49 | - (void)applicationWillTerminate:(UIApplication *)application { 50 | // Save data if appropriate 51 | } 52 | 53 | 54 | #pragma mark - 55 | #pragma mark Memory management 56 | 57 | - (void)dealloc { 58 | [navigationController release]; 59 | [window release]; 60 | [super dealloc]; 61 | } 62 | 63 | 64 | @end 65 | 66 | -------------------------------------------------------------------------------- /Demo/TableViewPull/Classes/View/LoadMoreTableFooterView/LoadMoreTableFooterView.h: -------------------------------------------------------------------------------- 1 | // 2 | // LoadMoreTableFooterView.h 3 | // TableViewPull 4 | // 5 | // Created by Ye Dingding on 10-12-24. 6 | // Copyright 2010 Intridea, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import 29 | 30 | typedef enum{ 31 | LoadMorePulling = 0, 32 | LoadMoreNormal, 33 | LoadMoreLoading, 34 | } LoadMoreState; 35 | 36 | @protocol LoadMoreTableFooterDelegate; 37 | @interface LoadMoreTableFooterView : UIView { 38 | id _delegate; 39 | LoadMoreState _state; 40 | 41 | UILabel *_statusLabel; 42 | UIActivityIndicatorView *_activityView; 43 | } 44 | 45 | @property(nonatomic,assign) id delegate; 46 | 47 | - (void)loadMoreScrollViewDidScroll:(UIScrollView *)scrollView; 48 | - (void)loadMoreScrollViewDidEndDragging:(UIScrollView *)scrollView; 49 | - (void)loadMoreScrollViewDataSourceDidFinishedLoading:(UIScrollView *)scrollView; 50 | 51 | @end 52 | 53 | @protocol LoadMoreTableFooterDelegate 54 | - (void)loadMoreTableFooterDidTriggerRefresh:(LoadMoreTableFooterView *)view; 55 | - (BOOL)loadMoreTableFooterDataSourceIsLoading:(LoadMoreTableFooterView *)view; 56 | @end 57 | -------------------------------------------------------------------------------- /Demo/TableViewPull/Classes/View/LoadMoreTableFooterView/LoadMoreTableFooterView.m: -------------------------------------------------------------------------------- 1 | // 2 | // LoadMoreTableFooterView.h 3 | // TableViewPull 4 | // 5 | // Created by Ye Dingding on 10-12-24. 6 | // Copyright 2010 Intridea, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import "LoadMoreTableFooterView.h" 29 | 30 | 31 | #define TEXT_COLOR [UIColor colorWithRed:87.0/255.0 green:108.0/255.0 blue:137.0/255.0 alpha:1.0] 32 | #define FLIP_ANIMATION_DURATION 0.18f 33 | 34 | 35 | @interface LoadMoreTableFooterView (Private) 36 | - (void)setState:(LoadMoreState)aState; 37 | @end 38 | 39 | @implementation LoadMoreTableFooterView 40 | 41 | @synthesize delegate=_delegate; 42 | 43 | 44 | - (id)initWithFrame:(CGRect)frame { 45 | if (self = [super initWithFrame:frame]) { 46 | 47 | self.autoresizingMask = UIViewAutoresizingFlexibleWidth; 48 | self.backgroundColor = [UIColor colorWithRed:226.0/255.0 green:231.0/255.0 blue:237.0/255.0 alpha:1.0]; 49 | 50 | UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0.0f, 20.0f, self.frame.size.width, 20.0f)]; 51 | label.autoresizingMask = UIViewAutoresizingFlexibleWidth; 52 | label.font = [UIFont boldSystemFontOfSize:15.0f]; 53 | label.textColor = TEXT_COLOR; 54 | label.shadowColor = [UIColor colorWithWhite:0.9f alpha:1.0f]; 55 | label.shadowOffset = CGSizeMake(0.0f, 1.0f); 56 | label.backgroundColor = [UIColor clearColor]; 57 | label.textAlignment = UITextAlignmentCenter; 58 | [self addSubview:label]; 59 | _statusLabel=label; 60 | [label release]; 61 | 62 | UIActivityIndicatorView *view = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; 63 | view.frame = CGRectMake(150.0f, 20.0f, 20.0f, 20.0f); 64 | [self addSubview:view]; 65 | _activityView = view; 66 | [view release]; 67 | self.hidden = YES; 68 | 69 | [self setState:LoadMoreNormal]; 70 | } 71 | 72 | return self; 73 | } 74 | 75 | 76 | #pragma mark - 77 | #pragma mark Setters 78 | 79 | - (void)setState:(LoadMoreState)aState{ 80 | switch (aState) { 81 | case LoadMorePulling: 82 | _statusLabel.text = NSLocalizedString(@"Release to load more...", @"Release to load more"); 83 | break; 84 | case LoadMoreNormal: 85 | _statusLabel.text = NSLocalizedString(@"Load More...", @"Load More"); 86 | _statusLabel.hidden = NO; 87 | [_activityView stopAnimating]; 88 | break; 89 | case LoadMoreLoading: 90 | _statusLabel.hidden = YES; 91 | [_activityView startAnimating]; 92 | break; 93 | default: 94 | break; 95 | } 96 | 97 | _state = aState; 98 | } 99 | 100 | 101 | #pragma mark - 102 | #pragma mark ScrollView Methods 103 | 104 | - (void)loadMoreScrollViewDidScroll:(UIScrollView *)scrollView { 105 | if (_state == LoadMoreLoading) { 106 | scrollView.contentInset = UIEdgeInsetsMake(0.0f, 0.0f, 60.0f, 0.0f); 107 | } else if (scrollView.isDragging) { 108 | 109 | BOOL _loading = NO; 110 | if ([_delegate respondsToSelector:@selector(loadMoreTableFooterDataSourceIsLoading:)]) { 111 | _loading = [_delegate loadMoreTableFooterDataSourceIsLoading:self]; 112 | } 113 | 114 | if (_state == LoadMoreNormal && scrollView.contentOffset.y < (scrollView.contentSize.height - 260) && scrollView.contentOffset.y > (scrollView.contentSize.height - 320) && !_loading) { 115 | self.frame = CGRectMake(0, scrollView.contentSize.height, self.frame.size.width, self.frame.size.height); 116 | self.hidden = NO; 117 | } else if (_state == LoadMoreNormal && scrollView.contentOffset.y > (scrollView.contentSize.height - 260) && !_loading) { 118 | [self setState:LoadMorePulling]; 119 | } else if (_state == LoadMorePulling && scrollView.contentOffset.y < (scrollView.contentSize.height - 260) && scrollView.contentOffset.y > (scrollView.contentSize.height - 320) && !_loading) { 120 | [self setState:LoadMoreNormal]; 121 | } 122 | 123 | if (scrollView.contentInset.bottom != 0) { 124 | scrollView.contentInset = UIEdgeInsetsZero; 125 | } 126 | } 127 | } 128 | 129 | - (void)loadMoreScrollViewDidEndDragging:(UIScrollView *)scrollView { 130 | 131 | BOOL _loading = NO; 132 | if ([_delegate respondsToSelector:@selector(loadMoreTableFooterDataSourceIsLoading:)]) { 133 | _loading = [_delegate loadMoreTableFooterDataSourceIsLoading:self]; 134 | } 135 | 136 | if (scrollView.contentOffset.y > (scrollView.contentSize.height - 260) && !_loading) { 137 | if ([_delegate respondsToSelector:@selector(loadMoreTableFooterDidTriggerRefresh:)]) { 138 | [_delegate loadMoreTableFooterDidTriggerRefresh:self]; 139 | } 140 | 141 | [self setState:LoadMoreLoading]; 142 | [UIView beginAnimations:nil context:NULL]; 143 | [UIView setAnimationDuration:0.2]; 144 | scrollView.contentInset = UIEdgeInsetsMake(0.0f, 0.0f, 60.0f, 0.0f); 145 | [UIView commitAnimations]; 146 | } 147 | } 148 | 149 | - (void)loadMoreScrollViewDataSourceDidFinishedLoading:(UIScrollView *)scrollView { 150 | [UIView beginAnimations:nil context:NULL]; 151 | [UIView setAnimationDuration:.3]; 152 | [scrollView setContentInset:UIEdgeInsetsMake(0.0f, 0.0f, 0.0f, 0.0f)]; 153 | [UIView commitAnimations]; 154 | 155 | [self setState:LoadMoreNormal]; 156 | self.hidden = YES; 157 | } 158 | 159 | 160 | #pragma mark - 161 | #pragma mark Dealloc 162 | 163 | - (void)dealloc { 164 | _delegate=nil; 165 | _activityView = nil; 166 | _statusLabel = nil; 167 | [super dealloc]; 168 | } 169 | 170 | 171 | @end -------------------------------------------------------------------------------- /Demo/TableViewPull/Resources/MainWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 784 5 | 10A394 6 | 732 7 | 1027.1 8 | 430.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 60 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | 35 | 36 | IBFirstResponder 37 | 38 | 39 | 40 | 41 | 1316 42 | 43 | {320, 480} 44 | 45 | 1 46 | MSAxIDEAA 47 | 48 | NO 49 | NO 50 | 51 | 52 | 53 | 54 | 55 | 56 | 256 57 | {0, 0} 58 | NO 59 | YES 60 | YES 61 | 62 | 63 | YES 64 | 65 | 66 | 67 | 68 | 69 | RootViewController 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | YES 78 | 79 | 80 | delegate 81 | 82 | 83 | 84 | 4 85 | 86 | 87 | 88 | window 89 | 90 | 91 | 92 | 5 93 | 94 | 95 | 96 | navigationController 97 | 98 | 99 | 100 | 15 101 | 102 | 103 | 104 | 105 | YES 106 | 107 | 0 108 | 109 | 110 | 111 | 112 | 113 | 2 114 | 115 | 116 | YES 117 | 118 | 119 | 120 | 121 | -1 122 | 123 | 124 | File's Owner 125 | 126 | 127 | 3 128 | 129 | 130 | 131 | 132 | -2 133 | 134 | 135 | 136 | 137 | 9 138 | 139 | 140 | YES 141 | 142 | 143 | 144 | 145 | 146 | 147 | 11 148 | 149 | 150 | 151 | 152 | 13 153 | 154 | 155 | YES 156 | 157 | 158 | 159 | 160 | 161 | 14 162 | 163 | 164 | 165 | 166 | 167 | 168 | YES 169 | 170 | YES 171 | -1.CustomClassName 172 | -2.CustomClassName 173 | 11.IBPluginDependency 174 | 13.CustomClassName 175 | 13.IBPluginDependency 176 | 2.IBAttributePlaceholdersKey 177 | 2.IBEditorWindowLastContentRect 178 | 2.IBPluginDependency 179 | 3.CustomClassName 180 | 3.IBPluginDependency 181 | 9.IBEditorWindowLastContentRect 182 | 9.IBPluginDependency 183 | 184 | 185 | YES 186 | UIApplication 187 | UIResponder 188 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 189 | RootViewController 190 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 191 | 192 | YES 193 | 194 | 195 | YES 196 | 197 | 198 | {{673, 376}, {320, 480}} 199 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 200 | TableViewPullAppDelegate 201 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 202 | {{500, 343}, {320, 480}} 203 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 204 | 205 | 206 | 207 | YES 208 | 209 | 210 | YES 211 | 212 | 213 | 214 | 215 | YES 216 | 217 | 218 | YES 219 | 220 | 221 | 222 | 15 223 | 224 | 225 | 226 | YES 227 | 228 | RootViewController 229 | UITableViewController 230 | 231 | IBProjectSource 232 | Classes/RootViewController.h 233 | 234 | 235 | 236 | TableViewPullAppDelegate 237 | NSObject 238 | 239 | YES 240 | 241 | YES 242 | navigationController 243 | window 244 | 245 | 246 | YES 247 | UINavigationController 248 | UIWindow 249 | 250 | 251 | 252 | IBProjectSource 253 | Classes/TableViewPullAppDelegate.h 254 | 255 | 256 | 257 | 258 | 0 259 | 260 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 261 | 262 | 263 | YES 264 | TableViewPull.xcodeproj 265 | 3 266 | 3.1 267 | 268 | 269 | -------------------------------------------------------------------------------- /Demo/TableViewPull/Resources/RootViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 784 5 | 10C540 6 | 759 7 | 1038.25 8 | 458.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 79 12 | 13 | 14 | YES 15 | 16 | 17 | YES 18 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 19 | 20 | 21 | YES 22 | 23 | YES 24 | 25 | 26 | YES 27 | 28 | 29 | 30 | YES 31 | 32 | IBFilesOwner 33 | IBCocoaTouchFramework 34 | 35 | 36 | IBFirstResponder 37 | IBCocoaTouchFramework 38 | 39 | 40 | 41 | 274 42 | {{554, 98}, {320, 247}} 43 | 44 | 3 45 | MQA 46 | 47 | YES 48 | IBCocoaTouchFramework 49 | NO 50 | 1 51 | 0 52 | YES 53 | 44 54 | 22 55 | 22 56 | 57 | 58 | 59 | 60 | YES 61 | 62 | 63 | view 64 | 65 | 66 | 67 | 9 68 | 69 | 70 | 71 | 72 | YES 73 | 74 | 0 75 | 76 | 77 | 78 | 79 | 80 | -1 81 | 82 | 83 | File's Owner 84 | 85 | 86 | -2 87 | 88 | 89 | 90 | 91 | 8 92 | 93 | 94 | 95 | 96 | 97 | 98 | YES 99 | 100 | YES 101 | -1.CustomClassName 102 | -2.CustomClassName 103 | 8.IBPluginDependency 104 | 105 | 106 | YES 107 | RootViewController 108 | UIResponder 109 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 110 | 111 | 112 | 113 | YES 114 | 115 | 116 | YES 117 | 118 | 119 | 120 | 121 | YES 122 | 123 | 124 | YES 125 | 126 | 127 | 128 | 9 129 | 130 | 131 | 132 | YES 133 | 134 | RootViewController 135 | UITableViewController 136 | 137 | IBProjectSource 138 | Classes/Controller/RootViewController/RootViewController.h 139 | 140 | 141 | 142 | 143 | YES 144 | 145 | NSObject 146 | 147 | IBFrameworkSource 148 | Foundation.framework/Headers/NSError.h 149 | 150 | 151 | 152 | NSObject 153 | 154 | IBFrameworkSource 155 | Foundation.framework/Headers/NSFileManager.h 156 | 157 | 158 | 159 | NSObject 160 | 161 | IBFrameworkSource 162 | Foundation.framework/Headers/NSKeyValueCoding.h 163 | 164 | 165 | 166 | NSObject 167 | 168 | IBFrameworkSource 169 | Foundation.framework/Headers/NSKeyValueObserving.h 170 | 171 | 172 | 173 | NSObject 174 | 175 | IBFrameworkSource 176 | Foundation.framework/Headers/NSKeyedArchiver.h 177 | 178 | 179 | 180 | NSObject 181 | 182 | IBFrameworkSource 183 | Foundation.framework/Headers/NSNetServices.h 184 | 185 | 186 | 187 | NSObject 188 | 189 | IBFrameworkSource 190 | Foundation.framework/Headers/NSObject.h 191 | 192 | 193 | 194 | NSObject 195 | 196 | IBFrameworkSource 197 | Foundation.framework/Headers/NSPort.h 198 | 199 | 200 | 201 | NSObject 202 | 203 | IBFrameworkSource 204 | Foundation.framework/Headers/NSRunLoop.h 205 | 206 | 207 | 208 | NSObject 209 | 210 | IBFrameworkSource 211 | Foundation.framework/Headers/NSStream.h 212 | 213 | 214 | 215 | NSObject 216 | 217 | IBFrameworkSource 218 | Foundation.framework/Headers/NSThread.h 219 | 220 | 221 | 222 | NSObject 223 | 224 | IBFrameworkSource 225 | Foundation.framework/Headers/NSURL.h 226 | 227 | 228 | 229 | NSObject 230 | 231 | IBFrameworkSource 232 | Foundation.framework/Headers/NSURLConnection.h 233 | 234 | 235 | 236 | NSObject 237 | 238 | IBFrameworkSource 239 | Foundation.framework/Headers/NSXMLParser.h 240 | 241 | 242 | 243 | NSObject 244 | 245 | IBFrameworkSource 246 | QuartzCore.framework/Headers/CAAnimation.h 247 | 248 | 249 | 250 | NSObject 251 | 252 | IBFrameworkSource 253 | QuartzCore.framework/Headers/CALayer.h 254 | 255 | 256 | 257 | NSObject 258 | 259 | IBFrameworkSource 260 | UIKit.framework/Headers/UIAccessibility.h 261 | 262 | 263 | 264 | NSObject 265 | 266 | IBFrameworkSource 267 | UIKit.framework/Headers/UINibLoading.h 268 | 269 | 270 | 271 | NSObject 272 | 273 | IBFrameworkSource 274 | UIKit.framework/Headers/UIResponder.h 275 | 276 | 277 | 278 | UIResponder 279 | NSObject 280 | 281 | 282 | 283 | UIScrollView 284 | UIView 285 | 286 | IBFrameworkSource 287 | UIKit.framework/Headers/UIScrollView.h 288 | 289 | 290 | 291 | UISearchBar 292 | UIView 293 | 294 | IBFrameworkSource 295 | UIKit.framework/Headers/UISearchBar.h 296 | 297 | 298 | 299 | UISearchDisplayController 300 | NSObject 301 | 302 | IBFrameworkSource 303 | UIKit.framework/Headers/UISearchDisplayController.h 304 | 305 | 306 | 307 | UITableView 308 | UIScrollView 309 | 310 | IBFrameworkSource 311 | UIKit.framework/Headers/UITableView.h 312 | 313 | 314 | 315 | UITableViewController 316 | UIViewController 317 | 318 | IBFrameworkSource 319 | UIKit.framework/Headers/UITableViewController.h 320 | 321 | 322 | 323 | UIView 324 | 325 | IBFrameworkSource 326 | UIKit.framework/Headers/UITextField.h 327 | 328 | 329 | 330 | UIView 331 | UIResponder 332 | 333 | IBFrameworkSource 334 | UIKit.framework/Headers/UIView.h 335 | 336 | 337 | 338 | UIViewController 339 | 340 | IBFrameworkSource 341 | UIKit.framework/Headers/UINavigationController.h 342 | 343 | 344 | 345 | UIViewController 346 | 347 | IBFrameworkSource 348 | UIKit.framework/Headers/UITabBarController.h 349 | 350 | 351 | 352 | UIViewController 353 | UIResponder 354 | 355 | IBFrameworkSource 356 | UIKit.framework/Headers/UIViewController.h 357 | 358 | 359 | 360 | 361 | 0 362 | IBCocoaTouchFramework 363 | 364 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 365 | 366 | 367 | 368 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 369 | 370 | 371 | YES 372 | ../TableViewPull.xcodeproj 373 | 3 374 | 79 375 | 376 | 377 | 378 | -------------------------------------------------------------------------------- /Demo/TableViewPull/Resources/TableViewPull-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | NSMainNibFile 28 | MainWindow 29 | 30 | 31 | -------------------------------------------------------------------------------- /Demo/TableViewPull/TableViewPull.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 45; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 019B070312CB369D00F1DB90 /* LoadMoreTableFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 019B070212CB369D00F1DB90 /* LoadMoreTableFooterView.m */; }; 11 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 12 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; 13 | 2892E4100DC94CBA00A64D0F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */; }; 14 | 28AD73600D9D9599002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD735F0D9D9599002E5188 /* MainWindow.xib */; }; 15 | 28F335F11007B36200424DE2 /* RootViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28F335F01007B36200424DE2 /* RootViewController.xib */; }; 16 | 3A25816E1088BEE600126784 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A25816D1088BEE600126784 /* QuartzCore.framework */; }; 17 | 3A3D908E11187FE7002B6585 /* TableViewPullAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A3D908D11187FE7002B6585 /* TableViewPullAppDelegate.m */; }; 18 | 3A3D90A8111881DE002B6585 /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A3D90A7111881DE002B6585 /* RootViewController.m */; }; 19 | 3A3D910311188495002B6585 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A3D910211188495002B6585 /* main.m */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXFileReference section */ 23 | 019B070112CB369D00F1DB90 /* LoadMoreTableFooterView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoadMoreTableFooterView.h; sourceTree = ""; }; 24 | 019B070212CB369D00F1DB90 /* LoadMoreTableFooterView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoadMoreTableFooterView.m; sourceTree = ""; }; 25 | 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 26 | 1D6058910D05DD3D006BFB54 /* TableViewPull.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TableViewPull.app; sourceTree = BUILT_PRODUCTS_DIR; }; 27 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 28 | 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 29 | 28AD735F0D9D9599002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; 30 | 28F335F01007B36200424DE2 /* RootViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = RootViewController.xib; sourceTree = ""; }; 31 | 3A25816D1088BEE600126784 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 32 | 3A3D908C11187FE7002B6585 /* TableViewPullAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableViewPullAppDelegate.h; sourceTree = ""; }; 33 | 3A3D908D11187FE7002B6585 /* TableViewPullAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TableViewPullAppDelegate.m; sourceTree = ""; }; 34 | 3A3D90A6111881DE002B6585 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = ""; }; 35 | 3A3D90A7111881DE002B6585 /* RootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RootViewController.m; sourceTree = ""; }; 36 | 3A3D90C411188297002B6585 /* TableViewPull_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableViewPull_Prefix.pch; sourceTree = ""; }; 37 | 3A3D910211188495002B6585 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 38 | 8D1107310486CEB800E47090 /* TableViewPull-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "TableViewPull-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; 39 | /* End PBXFileReference section */ 40 | 41 | /* Begin PBXFrameworksBuildPhase section */ 42 | 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { 43 | isa = PBXFrameworksBuildPhase; 44 | buildActionMask = 2147483647; 45 | files = ( 46 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, 47 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 48 | 2892E4100DC94CBA00A64D0F /* CoreGraphics.framework in Frameworks */, 49 | 3A25816E1088BEE600126784 /* QuartzCore.framework in Frameworks */, 50 | ); 51 | runOnlyForDeploymentPostprocessing = 0; 52 | }; 53 | /* End PBXFrameworksBuildPhase section */ 54 | 55 | /* Begin PBXGroup section */ 56 | 019B06FC12CB362F00F1DB90 /* LoadMoreTableFooterView */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | 019B070112CB369D00F1DB90 /* LoadMoreTableFooterView.h */, 60 | 019B070212CB369D00F1DB90 /* LoadMoreTableFooterView.m */, 61 | ); 62 | path = LoadMoreTableFooterView; 63 | sourceTree = ""; 64 | }; 65 | 080E96DDFE201D6D7F000001 /* Classes */ = { 66 | isa = PBXGroup; 67 | children = ( 68 | 3A3D90931118801F002B6585 /* Controller */, 69 | 3A3D909211188012002B6585 /* View */, 70 | 3A3D908411187FAD002B6585 /* Delegate */, 71 | ); 72 | path = Classes; 73 | sourceTree = ""; 74 | }; 75 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 76 | isa = PBXGroup; 77 | children = ( 78 | 1D6058910D05DD3D006BFB54 /* TableViewPull.app */, 79 | ); 80 | name = Products; 81 | sourceTree = ""; 82 | }; 83 | 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 080E96DDFE201D6D7F000001 /* Classes */, 87 | 29B97317FDCFA39411CA2CEA /* Resources */, 88 | 2CCD9B351243C916006B1864 /* Other Sources */, 89 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 90 | 19C28FACFE9D520D11CA2CBB /* Products */, 91 | 3A25816D1088BEE600126784 /* QuartzCore.framework */, 92 | ); 93 | name = CustomTemplate; 94 | sourceTree = ""; 95 | }; 96 | 29B97317FDCFA39411CA2CEA /* Resources */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 28F335F01007B36200424DE2 /* RootViewController.xib */, 100 | 28AD735F0D9D9599002E5188 /* MainWindow.xib */, 101 | 8D1107310486CEB800E47090 /* TableViewPull-Info.plist */, 102 | ); 103 | path = Resources; 104 | sourceTree = ""; 105 | }; 106 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, 110 | 1D30AB110D05D00D00671497 /* Foundation.framework */, 111 | 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */, 112 | ); 113 | name = Frameworks; 114 | sourceTree = ""; 115 | }; 116 | 2CCD9B351243C916006B1864 /* Other Sources */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | 3A3D910211188495002B6585 /* main.m */, 120 | 3A3D90C411188297002B6585 /* TableViewPull_Prefix.pch */, 121 | ); 122 | name = "Other Sources"; 123 | sourceTree = ""; 124 | }; 125 | 3A3D908411187FAD002B6585 /* Delegate */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | 3A3D908C11187FE7002B6585 /* TableViewPullAppDelegate.h */, 129 | 3A3D908D11187FE7002B6585 /* TableViewPullAppDelegate.m */, 130 | ); 131 | path = Delegate; 132 | sourceTree = ""; 133 | }; 134 | 3A3D909211188012002B6585 /* View */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | 019B06FC12CB362F00F1DB90 /* LoadMoreTableFooterView */, 138 | ); 139 | path = View; 140 | sourceTree = ""; 141 | }; 142 | 3A3D90931118801F002B6585 /* Controller */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | 3A3D90A5111881DE002B6585 /* RootViewController */, 146 | ); 147 | path = Controller; 148 | sourceTree = ""; 149 | }; 150 | 3A3D90A5111881DE002B6585 /* RootViewController */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | 3A3D90A6111881DE002B6585 /* RootViewController.h */, 154 | 3A3D90A7111881DE002B6585 /* RootViewController.m */, 155 | ); 156 | path = RootViewController; 157 | sourceTree = ""; 158 | }; 159 | /* End PBXGroup section */ 160 | 161 | /* Begin PBXNativeTarget section */ 162 | 1D6058900D05DD3D006BFB54 /* TableViewPull */ = { 163 | isa = PBXNativeTarget; 164 | buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "TableViewPull" */; 165 | buildPhases = ( 166 | 1D60588D0D05DD3D006BFB54 /* Resources */, 167 | 1D60588E0D05DD3D006BFB54 /* Sources */, 168 | 1D60588F0D05DD3D006BFB54 /* Frameworks */, 169 | ); 170 | buildRules = ( 171 | ); 172 | dependencies = ( 173 | ); 174 | name = TableViewPull; 175 | productName = TableViewPull; 176 | productReference = 1D6058910D05DD3D006BFB54 /* TableViewPull.app */; 177 | productType = "com.apple.product-type.application"; 178 | }; 179 | /* End PBXNativeTarget section */ 180 | 181 | /* Begin PBXProject section */ 182 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 183 | isa = PBXProject; 184 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "TableViewPull" */; 185 | compatibilityVersion = "Xcode 3.1"; 186 | developmentRegion = English; 187 | hasScannedForEncodings = 1; 188 | knownRegions = ( 189 | English, 190 | Japanese, 191 | French, 192 | German, 193 | en, 194 | ); 195 | mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; 196 | projectDirPath = ""; 197 | projectRoot = ""; 198 | targets = ( 199 | 1D6058900D05DD3D006BFB54 /* TableViewPull */, 200 | ); 201 | }; 202 | /* End PBXProject section */ 203 | 204 | /* Begin PBXResourcesBuildPhase section */ 205 | 1D60588D0D05DD3D006BFB54 /* Resources */ = { 206 | isa = PBXResourcesBuildPhase; 207 | buildActionMask = 2147483647; 208 | files = ( 209 | 28AD73600D9D9599002E5188 /* MainWindow.xib in Resources */, 210 | 28F335F11007B36200424DE2 /* RootViewController.xib in Resources */, 211 | ); 212 | runOnlyForDeploymentPostprocessing = 0; 213 | }; 214 | /* End PBXResourcesBuildPhase section */ 215 | 216 | /* Begin PBXSourcesBuildPhase section */ 217 | 1D60588E0D05DD3D006BFB54 /* Sources */ = { 218 | isa = PBXSourcesBuildPhase; 219 | buildActionMask = 2147483647; 220 | files = ( 221 | 3A3D908E11187FE7002B6585 /* TableViewPullAppDelegate.m in Sources */, 222 | 3A3D90A8111881DE002B6585 /* RootViewController.m in Sources */, 223 | 3A3D910311188495002B6585 /* main.m in Sources */, 224 | 019B070312CB369D00F1DB90 /* LoadMoreTableFooterView.m in Sources */, 225 | ); 226 | runOnlyForDeploymentPostprocessing = 0; 227 | }; 228 | /* End PBXSourcesBuildPhase section */ 229 | 230 | /* Begin XCBuildConfiguration section */ 231 | 1D6058940D05DD3E006BFB54 /* Debug */ = { 232 | isa = XCBuildConfiguration; 233 | buildSettings = { 234 | ALWAYS_SEARCH_USER_PATHS = NO; 235 | COPY_PHASE_STRIP = NO; 236 | GCC_DYNAMIC_NO_PIC = NO; 237 | GCC_OPTIMIZATION_LEVEL = 0; 238 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 239 | GCC_PREFIX_HEADER = TableViewPull_Prefix.pch; 240 | INFOPLIST_FILE = "Resources/TableViewPull-Info.plist"; 241 | IPHONEOS_DEPLOYMENT_TARGET = 3.0; 242 | PRODUCT_NAME = TableViewPull; 243 | TARGETED_DEVICE_FAMILY = "1,2"; 244 | }; 245 | name = Debug; 246 | }; 247 | 1D6058950D05DD3E006BFB54 /* Release */ = { 248 | isa = XCBuildConfiguration; 249 | buildSettings = { 250 | ALWAYS_SEARCH_USER_PATHS = NO; 251 | COPY_PHASE_STRIP = YES; 252 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 253 | GCC_PREFIX_HEADER = TableViewPull_Prefix.pch; 254 | INFOPLIST_FILE = "Resources/TableViewPull-Info.plist"; 255 | IPHONEOS_DEPLOYMENT_TARGET = 3.0; 256 | PRODUCT_NAME = TableViewPull; 257 | TARGETED_DEVICE_FAMILY = "1,2"; 258 | }; 259 | name = Release; 260 | }; 261 | C01FCF4F08A954540054247B /* Debug */ = { 262 | isa = XCBuildConfiguration; 263 | buildSettings = { 264 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 265 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 266 | GCC_C_LANGUAGE_STANDARD = c99; 267 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 268 | GCC_WARN_UNUSED_VARIABLE = YES; 269 | IPHONEOS_DEPLOYMENT_TARGET = 3.0; 270 | PREBINDING = NO; 271 | SDKROOT = iphoneos4.2; 272 | }; 273 | name = Debug; 274 | }; 275 | C01FCF5008A954540054247B /* Release */ = { 276 | isa = XCBuildConfiguration; 277 | buildSettings = { 278 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 279 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 280 | GCC_C_LANGUAGE_STANDARD = c99; 281 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 282 | GCC_WARN_UNUSED_VARIABLE = YES; 283 | IPHONEOS_DEPLOYMENT_TARGET = 3.0; 284 | PREBINDING = NO; 285 | SDKROOT = iphoneos4.2; 286 | }; 287 | name = Release; 288 | }; 289 | /* End XCBuildConfiguration section */ 290 | 291 | /* Begin XCConfigurationList section */ 292 | 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "TableViewPull" */ = { 293 | isa = XCConfigurationList; 294 | buildConfigurations = ( 295 | 1D6058940D05DD3E006BFB54 /* Debug */, 296 | 1D6058950D05DD3E006BFB54 /* Release */, 297 | ); 298 | defaultConfigurationIsVisible = 0; 299 | defaultConfigurationName = Release; 300 | }; 301 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "TableViewPull" */ = { 302 | isa = XCConfigurationList; 303 | buildConfigurations = ( 304 | C01FCF4F08A954540054247B /* Debug */, 305 | C01FCF5008A954540054247B /* Release */, 306 | ); 307 | defaultConfigurationIsVisible = 0; 308 | defaultConfigurationName = Release; 309 | }; 310 | /* End XCConfigurationList section */ 311 | }; 312 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 313 | } 314 | -------------------------------------------------------------------------------- /Demo/TableViewPull/TableViewPull_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'TableViewPull' target in the 'TableViewPull' project 3 | // 4 | #import 5 | 6 | #ifndef __IPHONE_3_0 7 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 8 | #endif 9 | 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Demo/TableViewPull/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TableViewPull 4 | // 5 | // Created by Devin Doty on 10/16/09October16. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) { 12 | 13 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /LoadMoreTableFooterView/Classes/LoadMoreTableFooterView.h: -------------------------------------------------------------------------------- 1 | // 2 | // LoadMoreTableFooterView.h 3 | // 4 | // Created by Ye Dingding on 10-12-24. 5 | // Copyright 2010 Intridea, Inc. All rights reserved. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | typedef enum{ 29 | LoadMorePulling = 0, 30 | LoadMoreNormal, 31 | LoadMoreLoading, 32 | } LoadMoreState; 33 | 34 | @protocol LoadMoreTableFooterDelegate; 35 | @interface LoadMoreTableFooterView : UIView { 36 | id _delegate; 37 | LoadMoreState _state; 38 | 39 | UILabel *_statusLabel; 40 | UIActivityIndicatorView *_activityView; 41 | } 42 | 43 | @property(nonatomic,assign) id delegate; 44 | 45 | - (void)loadMoreScrollViewDidScroll:(UIScrollView *)scrollView; 46 | - (void)loadMoreScrollViewDidEndDragging:(UIScrollView *)scrollView; 47 | - (void)loadMoreScrollViewDataSourceDidFinishedLoading:(UIScrollView *)scrollView; 48 | 49 | @end 50 | 51 | @protocol LoadMoreTableFooterDelegate 52 | - (void)loadMoreTableFooterDidTriggerRefresh:(LoadMoreTableFooterView *)view; 53 | - (BOOL)loadMoreTableFooterDataSourceIsLoading:(LoadMoreTableFooterView *)view; 54 | @end 55 | -------------------------------------------------------------------------------- /LoadMoreTableFooterView/Classes/LoadMoreTableFooterView.m: -------------------------------------------------------------------------------- 1 | // 2 | // LoadMoreTableFooterView.h 3 | // 4 | // Created by Ye Dingding on 10-12-24. 5 | // Copyright 2010 Intridea, Inc. All rights reserved. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | 27 | #import "LoadMoreTableFooterView.h" 28 | 29 | 30 | #define TEXT_COLOR [UIColor colorWithRed:87.0/255.0 green:108.0/255.0 blue:137.0/255.0 alpha:1.0] 31 | #define FLIP_ANIMATION_DURATION 0.18f 32 | 33 | 34 | @interface LoadMoreTableFooterView (Private) 35 | - (void)setState:(LoadMoreState)aState; 36 | @end 37 | 38 | @implementation LoadMoreTableFooterView 39 | 40 | @synthesize delegate=_delegate; 41 | 42 | 43 | - (id)initWithFrame:(CGRect)frame { 44 | if (self = [super initWithFrame:frame]) { 45 | 46 | self.autoresizingMask = UIViewAutoresizingFlexibleWidth; 47 | self.backgroundColor = [UIColor colorWithRed:226.0/255.0 green:231.0/255.0 blue:237.0/255.0 alpha:1.0]; 48 | 49 | UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0.0f, 20.0f, self.frame.size.width, 20.0f)]; 50 | label.autoresizingMask = UIViewAutoresizingFlexibleWidth; 51 | label.font = [UIFont boldSystemFontOfSize:15.0f]; 52 | label.textColor = TEXT_COLOR; 53 | label.shadowColor = [UIColor colorWithWhite:0.9f alpha:1.0f]; 54 | label.shadowOffset = CGSizeMake(0.0f, 1.0f); 55 | label.backgroundColor = [UIColor clearColor]; 56 | label.textAlignment = UITextAlignmentCenter; 57 | [self addSubview:label]; 58 | _statusLabel=label; 59 | [label release]; 60 | 61 | UIActivityIndicatorView *view = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; 62 | view.frame = CGRectMake(150.0f, 20.0f, 20.0f, 20.0f); 63 | [self addSubview:view]; 64 | _activityView = view; 65 | [view release]; 66 | self.hidden = YES; 67 | 68 | [self setState:LoadMoreNormal]; 69 | } 70 | 71 | return self; 72 | } 73 | 74 | 75 | #pragma mark - 76 | #pragma mark Setters 77 | 78 | - (void)setState:(LoadMoreState)aState{ 79 | switch (aState) { 80 | case LoadMorePulling: 81 | _statusLabel.text = NSLocalizedString(@"Release to load more...", @"Release to load more"); 82 | break; 83 | case LoadMoreNormal: 84 | _statusLabel.text = NSLocalizedString(@"Load More...", @"Load More"); 85 | _statusLabel.hidden = NO; 86 | [_activityView stopAnimating]; 87 | break; 88 | case LoadMoreLoading: 89 | _statusLabel.hidden = YES; 90 | [_activityView startAnimating]; 91 | break; 92 | default: 93 | break; 94 | } 95 | 96 | _state = aState; 97 | } 98 | 99 | 100 | #pragma mark - 101 | #pragma mark ScrollView Methods 102 | 103 | - (void)loadMoreScrollViewDidScroll:(UIScrollView *)scrollView { 104 | if (_state == LoadMoreLoading) { 105 | scrollView.contentInset = UIEdgeInsetsMake(0.0f, 0.0f, 60.0f, 0.0f); 106 | } else if (scrollView.isDragging) { 107 | 108 | BOOL _loading = NO; 109 | if ([_delegate respondsToSelector:@selector(loadMoreTableFooterDataSourceIsLoading:)]) { 110 | _loading = [_delegate loadMoreTableFooterDataSourceIsLoading:self]; 111 | } 112 | 113 | if (_state == LoadMoreNormal && scrollView.contentOffset.y < (scrollView.contentSize.height - 260) && scrollView.contentOffset.y > (scrollView.contentSize.height - 320) && !_loading) { 114 | self.frame = CGRectMake(0, scrollView.contentSize.height, self.frame.size.width, self.frame.size.height); 115 | self.hidden = NO; 116 | } else if (_state == LoadMoreNormal && scrollView.contentOffset.y > (scrollView.contentSize.height - 260) && !_loading) { 117 | [self setState:LoadMorePulling]; 118 | } else if (_state == LoadMorePulling && scrollView.contentOffset.y < (scrollView.contentSize.height - 260) && scrollView.contentOffset.y > (scrollView.contentSize.height - 320) && !_loading) { 119 | [self setState:LoadMoreNormal]; 120 | } 121 | 122 | if (scrollView.contentInset.bottom != 0) { 123 | scrollView.contentInset = UIEdgeInsetsZero; 124 | } 125 | } 126 | } 127 | 128 | - (void)loadMoreScrollViewDidEndDragging:(UIScrollView *)scrollView { 129 | 130 | BOOL _loading = NO; 131 | if ([_delegate respondsToSelector:@selector(loadMoreTableFooterDataSourceIsLoading:)]) { 132 | _loading = [_delegate loadMoreTableFooterDataSourceIsLoading:self]; 133 | } 134 | 135 | if (scrollView.contentOffset.y > (scrollView.contentSize.height - 260) && !_loading) { 136 | if ([_delegate respondsToSelector:@selector(loadMoreTableFooterDidTriggerRefresh:)]) { 137 | [_delegate loadMoreTableFooterDidTriggerRefresh:self]; 138 | } 139 | 140 | [self setState:LoadMoreLoading]; 141 | [UIView beginAnimations:nil context:NULL]; 142 | [UIView setAnimationDuration:0.2]; 143 | scrollView.contentInset = UIEdgeInsetsMake(0.0f, 0.0f, 60.0f, 0.0f); 144 | [UIView commitAnimations]; 145 | } 146 | } 147 | 148 | - (void)loadMoreScrollViewDataSourceDidFinishedLoading:(UIScrollView *)scrollView { 149 | [UIView beginAnimations:nil context:NULL]; 150 | [UIView setAnimationDuration:.3]; 151 | [scrollView setContentInset:UIEdgeInsetsMake(0.0f, 0.0f, 0.0f, 0.0f)]; 152 | [UIView commitAnimations]; 153 | 154 | [self setState:LoadMoreNormal]; 155 | self.hidden = YES; 156 | } 157 | 158 | 159 | #pragma mark - 160 | #pragma mark Dealloc 161 | 162 | - (void)dealloc { 163 | _delegate=nil; 164 | _activityView = nil; 165 | _statusLabel = nil; 166 | [super dealloc]; 167 | } 168 | 169 | 170 | @end 171 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | == DESCRIPTION: 2 | 3 | Inspired by EGOTableViewPullRefresh[https://github.com/enormego/EGOTableViewPullRefresh], a similar control 4 | to the pull down to refresh control created by atebits in Tweetie 2, I implement this simple control to 5 | load more rows into the table. 6 | 7 | == Usage: 8 | 9 | Check the demo. Thanks for enormego. Most of the codes are directly copied from their demo. 10 | 11 | == LICENSE: 12 | 13 | Copyright (c) 2010 Dingding Ye and Intridea, Inc. ( http://intridea.com ), released under the MIT License. 14 | --------------------------------------------------------------------------------