├── Misc ├── graph.png └── graph.graphml ├── DRTableViewManagerExample ├── UI │ ├── Example 2 │ │ ├── Example2Label.h │ │ ├── Example2ViewController.h │ │ ├── Example2TableViewCell.h │ │ ├── Example2Label.m │ │ ├── Example2TableViewCell.m │ │ └── Example2ViewController.m │ ├── Example 1 │ │ ├── Example1ViewController.h │ │ └── Example1ViewController.m │ └── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard ├── Application │ ├── AppDelegate.h │ └── AppDelegate.m ├── Supporting Files │ ├── main.m │ └── Info.plist └── Resources │ └── Images.xcassets │ ├── LaunchImage.launchimage │ └── Contents.json │ └── AppIcon.appiconset │ └── Contents.json ├── DRTableViewManager.podspec ├── DRTableViewManager ├── DRTableViewSectionsController.h ├── DRTableViewGenericSectionsController.h ├── DRTableViewManager.h ├── DRTableViewSection.h ├── DRTableViewGenericSectionsController.m ├── DRTableViewGenericSection.h ├── DRTableViewRow.h ├── DRTableViewGenericRow.h ├── DRTableViewGenericSection.m ├── DRTableViewGenericRow.m └── DRTableViewManager.m ├── .gitignore ├── DRTableViewManagerExampleTests ├── Supporting Files │ └── Info.plist └── DRTableViewManagerExampleTests.m ├── LICENSE ├── DRTableViewManagerExample.xcodeproj ├── xcshareddata │ └── xcschemes │ │ └── DRTableViewManagerExample.xcscheme └── project.pbxproj └── README.md /Misc/graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrarski/DRTableViewManager-iOS/HEAD/Misc/graph.png -------------------------------------------------------------------------------- /DRTableViewManagerExample/UI/Example 2/Example2Label.h: -------------------------------------------------------------------------------- 1 | // 2 | // Example2Label.h 3 | // DRTableViewManagerExample 4 | // 5 | // Created by Dariusz Rybicki on 07/03/15. 6 | // Copyright (c) 2015 Darrarski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Example2Label : UILabel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /DRTableViewManagerExample/UI/Example 2/Example2ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // Example2ViewController.h 3 | // DRTableViewManagerExample 4 | // 5 | // Created by Dariusz Rybicki on 06/03/15. 6 | // Copyright (c) 2015 Darrarski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Example2ViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /DRTableViewManagerExample/UI/Example 1/Example1ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // Example1ViewController.h 3 | // DRTableViewManagerExample 4 | // 5 | // Created by Dariusz Rybicki on 02/03/15. 6 | // Copyright (c) 2015 Darrarski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Example1ViewController : UITableViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /DRTableViewManagerExample/Application/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // DRTableViewManagerExample 4 | // 5 | // Created by Dariusz Rybicki on 02/03/15. 6 | // Copyright (c) 2015 Darrarski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /DRTableViewManagerExample/UI/Example 2/Example2TableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // Example2TableViewCell.h 3 | // DRTableViewManagerExample 4 | // 5 | // Created by Dariusz Rybicki on 06/03/15. 6 | // Copyright (c) 2015 Darrarski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class Example2Label; 12 | 13 | @interface Example2TableViewCell : UITableViewCell 14 | 15 | @property (weak, nonatomic) Example2Label *exampleLabel; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /DRTableViewManagerExample/Supporting Files/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // DRTableViewManagerExample 4 | // 5 | // Created by Dariusz Rybicki on 02/03/15. 6 | // Copyright (c) 2015 Darrarski. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DRTableViewManagerExample/Resources/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 | "extent" : "full-screen", 14 | "minimum-system-version" : "7.0", 15 | "subtype" : "retina4", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /DRTableViewManager.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'DRTableViewManager' 3 | s.version = '1.0.13' 4 | s.summary = 'Object-oriented UITableViewDataSource and UITableViewDelegate protocols proxy' 5 | s.homepage = 'https://github.com/darrarski/DRTableViewManager-iOS' 6 | s.license = { :type => 'MIT', :file => 'LICENSE' } 7 | s.author = { 'Dariusz Rybicki' => 'darrarski@gmail.com' } 8 | s.source = { :git => 'https://github.com/darrarski/DRTableViewManager-iOS.git', :tag => 'v1.0.13' } 9 | s.platform = :ios 10 | s.ios.deployment_target = "7.0" 11 | s.source_files = 'DRTableViewManager' 12 | s.requires_arc = true 13 | end 14 | -------------------------------------------------------------------------------- /DRTableViewManager/DRTableViewSectionsController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DRTableViewSectionsController.h 3 | // DRTableViewManager 4 | // 5 | // Created by Dariusz Rybicki on 02/03/15. 6 | // Copyright (c) 2015 Darrarski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol DRTableViewSection; 12 | 13 | @protocol DRTableViewSectionsController 14 | 15 | @required 16 | 17 | - (NSInteger)sectionsCount; 18 | - (NSObject *)sectionAtIndex:(NSInteger)index; 19 | 20 | @optional 21 | 22 | - (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView; 23 | - (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################################ 2 | # OS X 3 | 4 | *.DS_Store 5 | *.swp 6 | .Trashes 7 | *.lock 8 | 9 | ################################ 10 | # Xcode 11 | 12 | *.pbxuser 13 | !default.pbxuser 14 | *.mode1v3 15 | !default.mode1v3 16 | *.mode2v3 17 | !default.mode2v3 18 | *.perspective 19 | !default.perspective 20 | *.perspectivev3 21 | !default.perspectivev3 22 | *.xcuserstate 23 | project.xcworkspace/ 24 | xcuserdata/ 25 | build/ 26 | dist/ 27 | DerivedData/ 28 | *.moved-aside 29 | *.xccheckout 30 | 31 | ################################ 32 | # AppCode 33 | 34 | .idea 35 | 36 | ################################ 37 | # Backup files 38 | 39 | *~ 40 | *~.nib 41 | *~.xib 42 | \#*# 43 | .#* 44 | 45 | ################################ 46 | # CocoaPods 47 | 48 | Pods/ 49 | -------------------------------------------------------------------------------- /DRTableViewManagerExample/Resources/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /DRTableViewManagerExampleTests/Supporting Files/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | pl.darrarski.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /DRTableViewManager/DRTableViewGenericSectionsController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DRTableViewGenericSectionsController.h 3 | // DRTableViewManager 4 | // 5 | // Created by Dariusz Rybicki on 02/03/15. 6 | // Copyright (c) 2015 Darrarski. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DRTableViewSectionsController.h" 11 | 12 | @interface DRTableViewGenericSectionsController : NSObject 13 | 14 | @property (nonatomic, copy) NSInteger (^sectionsCountBlock)(); 15 | @property (nonatomic, copy) NSObject *(^sectionAtIndexBlock)(NSInteger index); 16 | @property (nonatomic, copy) NSArray *(^sectionIndexTitlesForTableViewBlock)(UITableView *tableView); 17 | @property (nonatomic, copy) NSInteger (^tableViewSectionForSectionIndexTitleAtIndexBlock)(UITableView *tableView, NSString *title, NSInteger index); 18 | 19 | @property (nonatomic, strong) NSArray *sectionsArray; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /DRTableViewManagerExample/UI/Example 2/Example2Label.m: -------------------------------------------------------------------------------- 1 | // 2 | // Example2Label.m 3 | // DRTableViewManagerExample 4 | // 5 | // Created by Dariusz Rybicki on 07/03/15. 6 | // Copyright (c) 2015 Darrarski. All rights reserved. 7 | // 8 | 9 | #import "Example2Label.h" 10 | 11 | @implementation Example2Label 12 | 13 | - (void)setBounds:(CGRect)bounds 14 | { 15 | [super setBounds:bounds]; 16 | [self updatePreferredMaxLayoutWidthIfNeeded]; 17 | } 18 | 19 | - (void)setNumberOfLines:(NSInteger)numberOfLines 20 | { 21 | [super setNumberOfLines:numberOfLines]; 22 | [self updatePreferredMaxLayoutWidthIfNeeded]; 23 | } 24 | 25 | - (void)updatePreferredMaxLayoutWidthIfNeeded 26 | { 27 | if (self.numberOfLines == 0 && (self.bounds.size.width != self.preferredMaxLayoutWidth || self.bounds.size.width == 0)) { 28 | self.preferredMaxLayoutWidth = self.bounds.size.width; 29 | [self setNeedsUpdateConstraints]; 30 | } 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Darrarski 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /DRTableViewManagerExampleTests/DRTableViewManagerExampleTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // DRTableViewManagerExampleTests.m 3 | // DRTableViewManagerExampleTests 4 | // 5 | // Created by Dariusz Rybicki on 02/03/15. 6 | // Copyright (c) 2015 Darrarski. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface DRTableViewManagerExampleTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation DRTableViewManagerExampleTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /DRTableViewManagerExample/Supporting Files/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | pl.darrarski.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /DRTableViewManager/DRTableViewManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // DRTableViewManager.h 3 | // DRTableViewManager 4 | // 5 | // Created by Dariusz Rybicki on 02/03/15. 6 | // Copyright (c) 2015 Darrarski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol DRTableViewSectionsController; 12 | @protocol DRTableViewSection; 13 | @protocol DRTableViewRow; 14 | 15 | typedef NS_ENUM(NSUInteger, DRTableViewAutomaticRowHeightResolvingType) { 16 | DRTableViewResolveAutomaticRowHeightAutomaticallyIfAvailable, 17 | DRTableViewResolveAutomaticRowHeightAutomatically NS_AVAILABLE_IOS(8_0), 18 | DRTableViewResolveAutomaticRowHeightManually, 19 | }; 20 | 21 | @interface DRTableViewManager : NSObject 22 | 23 | @property (nonatomic, assign) DRTableViewAutomaticRowHeightResolvingType automaticRowHeightResolvingType; 24 | @property (nonatomic, weak) id scrollViewDelegate; 25 | 26 | - (instancetype)initWithSectionsController:(NSObject *)sectionsController; 27 | - (void)registerInTableView:(UITableView *)tableView; 28 | - (UITableViewCell *)cachedCellForKey:(NSString *)key; 29 | - (void)setCachedCell:(UITableViewCell *)cell forKey:(NSString *)key; 30 | - (id )sectionAtIndex:(NSInteger)sectionIndex; 31 | - (id )sectionForFooterHeaderView:(UIView *)view atIndex:(NSInteger)sectionIndex; 32 | - (id )rowAtIndexPath:(NSIndexPath *)indexPath; 33 | - (id )rowForCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /DRTableViewManagerExample/UI/Example 2/Example2TableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // Example2TableViewCell.m 3 | // DRTableViewManagerExample 4 | // 5 | // Created by Dariusz Rybicki on 06/03/15. 6 | // Copyright (c) 2015 Darrarski. All rights reserved. 7 | // 8 | 9 | #import "Example2TableViewCell.h" 10 | #import "Example2Label.h" 11 | 12 | @implementation Example2TableViewCell 13 | 14 | - (void)prepareForReuse 15 | { 16 | [super prepareForReuse]; 17 | self.exampleLabel.text = nil; 18 | } 19 | 20 | - (Example2Label *)exampleLabel 21 | { 22 | if (_exampleLabel == nil) { 23 | Example2Label *label = [[Example2Label alloc] init]; 24 | [label setTranslatesAutoresizingMaskIntoConstraints:NO]; 25 | label.numberOfLines = 0; 26 | [self.contentView addSubview:label]; 27 | 28 | [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-(8)-[label]-(8)-|" 29 | options:0 30 | metrics:nil 31 | views:@{ @"label": label }]]; 32 | 33 | [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-(8)-[label]-(8)-|" 34 | options:0 35 | metrics:nil 36 | views:@{ @"label": label }]]; 37 | 38 | _exampleLabel = label; 39 | } 40 | 41 | return _exampleLabel; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /DRTableViewManager/DRTableViewSection.h: -------------------------------------------------------------------------------- 1 | // 2 | // DRTableViewSection.h 3 | // DRTableViewManager 4 | // 5 | // Created by Dariusz Rybicki on 02/03/15. 6 | // Copyright (c) 2015 Darrarski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol DRTableViewRow; 12 | 13 | @protocol DRTableViewSection 14 | 15 | @required 16 | 17 | - (NSObject *)rowAtIndex:(NSInteger)index; 18 | 19 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section; 20 | 21 | @optional 22 | 23 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section; 24 | - (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section; 25 | - (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section NS_AVAILABLE_IOS(6_0); 26 | - (void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)section NS_AVAILABLE_IOS(6_0); 27 | - (void)tableView:(UITableView *)tableView didEndDisplayingHeaderView:(UIView *)view forSection:(NSInteger)section NS_AVAILABLE_IOS(6_0); 28 | - (void)tableView:(UITableView *)tableView didEndDisplayingFooterView:(UIView *)view forSection:(NSInteger)section NS_AVAILABLE_IOS(6_0); 29 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section; 30 | - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section; 31 | - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForHeaderInSection:(NSInteger)section NS_AVAILABLE_IOS(7_0); 32 | - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForFooterInSection:(NSInteger)section NS_AVAILABLE_IOS(7_0); 33 | - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section; 34 | - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /DRTableViewManager/DRTableViewGenericSectionsController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DRTableViewGenericSectionsController.m 3 | // DRTableViewManager 4 | // 5 | // Created by Dariusz Rybicki on 02/03/15. 6 | // Copyright (c) 2015 Darrarski. All rights reserved. 7 | // 8 | 9 | #import "DRTableViewGenericSectionsController.h" 10 | 11 | @implementation DRTableViewGenericSectionsController 12 | 13 | - (NSArray *)sectionsArray 14 | { 15 | if (_sectionsArray == nil) { 16 | _sectionsArray = (NSArray *)@[]; 17 | } 18 | return _sectionsArray; 19 | } 20 | 21 | - (BOOL)respondsToSelector:(SEL)aSelector 22 | { 23 | if (aSelector == @selector(sectionIndexTitlesForTableView:) && _sectionIndexTitlesForTableViewBlock == nil) { 24 | return NO; 25 | } 26 | 27 | if (aSelector == @selector(tableView:sectionForSectionIndexTitle:atIndex:) && _tableViewSectionForSectionIndexTitleAtIndexBlock == nil) { 28 | return NO; 29 | } 30 | 31 | return [super respondsToSelector:aSelector]; 32 | } 33 | 34 | #pragma mark - DRTableViewSectionsController 35 | 36 | - (NSInteger)sectionsCount 37 | { 38 | if (_sectionsCountBlock != nil) { 39 | return _sectionsCountBlock(); 40 | } 41 | 42 | return [self.sectionsArray count]; 43 | } 44 | 45 | - (NSObject *)sectionAtIndex:(NSInteger)index 46 | { 47 | if (_sectionAtIndexBlock != nil) { 48 | return _sectionAtIndexBlock(index); 49 | } 50 | 51 | return self.sectionsArray[(NSUInteger)index]; 52 | } 53 | 54 | - (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView 55 | { 56 | if (_sectionIndexTitlesForTableViewBlock) { 57 | return _sectionIndexTitlesForTableViewBlock(tableView); 58 | } 59 | 60 | return nil; 61 | } 62 | 63 | - (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index 64 | { 65 | if (_tableViewSectionForSectionIndexTitleAtIndexBlock) { 66 | return _tableViewSectionForSectionIndexTitleAtIndexBlock(tableView, title, index); 67 | } 68 | 69 | return 0; 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /DRTableViewManagerExample/Application/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // DRTableViewManagerExample 4 | // 5 | // Created by Dariusz Rybicki on 02/03/15. 6 | // Copyright (c) 2015 Darrarski. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // 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. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // 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. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 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 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /DRTableViewManager/DRTableViewGenericSection.h: -------------------------------------------------------------------------------- 1 | // 2 | // DRTableViewGenericSection.h 3 | // DRTableViewManager 4 | // 5 | // Created by Dariusz Rybicki on 02/03/15. 6 | // Copyright (c) 2015 Darrarski. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DRTableViewSection.h" 11 | 12 | @interface DRTableViewGenericSection : NSObject 13 | 14 | @property (nonatomic, copy) NSObject *(^rowAtIndexBlock)(NSInteger index); 15 | 16 | @property (nonatomic, copy) NSInteger (^tableViewNumberOfRowsInSectionBlock)(UITableView *tableView, NSInteger section); 17 | @property (nonatomic, copy) NSString *(^tableViewTitleForHeaderInSectionBlock)(UITableView *tableView, NSInteger section); 18 | @property (nonatomic, copy) NSString *(^tableViewTitleForFooterInSectionBlock)(UITableView *tableView, NSInteger section); 19 | @property (nonatomic, copy) CGFloat (^tableViewHeightForHeaderInSectionBlock)(UITableView *tableView, NSInteger section); 20 | @property (nonatomic, copy) CGFloat (^tableViewHeightForFooterInSectionBlock)(UITableView *tableView, NSInteger section); 21 | @property (nonatomic, copy) CGFloat (^tableViewEstimatedHeightForHeaderInSectionBlock)(UITableView *tableView, NSInteger section); 22 | @property (nonatomic, copy) CGFloat (^tableViewEstimatedHeightForFooterInSectionBlock)(UITableView *tableView, NSInteger section); 23 | @property (nonatomic, copy) UIView *(^tableViewViewForHeaderInSectionBlock)(UITableView *tableView, NSInteger section); 24 | @property (nonatomic, copy) UIView *(^tableViewViewForFooterInSectionBlock)(UITableView *tableView, NSInteger section); 25 | @property (nonatomic, copy) void (^tableViewWillDisplayHeaderViewForSectionBlock)(UITableView *tableView, UIView *view, NSInteger section); 26 | @property (nonatomic, copy) void (^tableViewWillDisplayFooterViewForSectionBlock)(UITableView *tableView, UIView *view, NSInteger section); 27 | @property (nonatomic, copy) void (^tableViewDidEndDisplayingHeaderViewForSectionBlock)(UITableView *tableView, UIView *view, NSInteger section); 28 | @property (nonatomic, copy) void (^tableViewDidEndDisplayingFooterViewForSectionBlock)(UITableView *tableView, UIView *view, NSInteger section); 29 | 30 | @property (nonatomic, strong) NSArray *rowsArray; 31 | 32 | + (instancetype)newWithBlock:(void (^)(DRTableViewGenericSection *section))block; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /DRTableViewManagerExample/UI/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /DRTableViewManagerExample/UI/Example 2/Example2ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // Example2ViewController.m 3 | // DRTableViewManagerExample 4 | // 5 | // Created by Dariusz Rybicki on 06/03/15. 6 | // Copyright (c) 2015 Darrarski. All rights reserved. 7 | // 8 | 9 | #import "Example2ViewController.h" 10 | #import "DRTableViewManager.h" 11 | #import "DRTableViewGenericSectionsController.h" 12 | #import "DRTableViewGenericSection.h" 13 | #import "DRTableViewGenericRow.h" 14 | #import "Example2TableViewCell.h" 15 | #import "Example2Label.h" 16 | 17 | @interface Example2ViewController () 18 | 19 | @property (nonatomic, strong) DRTableViewManager *tableViewManager; 20 | 21 | @end 22 | 23 | @implementation Example2ViewController 24 | 25 | - (void)viewDidLoad 26 | { 27 | [super viewDidLoad]; 28 | 29 | [self.tableViewManager registerInTableView:self.tableView]; 30 | self.tableView.estimatedRowHeight = 44; 31 | [self.tableView registerClass:[Example2TableViewCell class] forCellReuseIdentifier:@"cell"]; 32 | } 33 | 34 | - (DRTableViewManager *)tableViewManager 35 | { 36 | if (_tableViewManager == nil) { 37 | DRTableViewGenericRow *textRow = [DRTableViewGenericRow newWithBlock:^(DRTableViewGenericRow *row) { 38 | 39 | row.tableViewCellForRowAtIndexPathBlock = ^UITableViewCell *(UITableView *tableView, NSIndexPath *indexPath) { 40 | return [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath]; 41 | }; 42 | 43 | row.tableViewHeightForRowAtIndexPathBlock = ^CGFloat(UITableView *tableView, NSIndexPath *indexPath) { 44 | return UITableViewAutomaticDimension; 45 | }; 46 | 47 | // Required only under iOS 7 when using UITableViewAutomaticDimension above: 48 | row.tableViewManagerTableViewCellForComputingRowHeightAtIndexPathBlock = ^UITableViewCell *(DRTableViewManager *tableViewManager, UITableView *tableView, NSIndexPath *indexPath) { 49 | if (![tableViewManager cachedCellForKey:@"cell"]) { 50 | [tableViewManager setCachedCell:[tableView dequeueReusableCellWithIdentifier:@"cell"] forKey:@"cell"]; 51 | } 52 | return [tableViewManager cachedCellForKey:@"cell"]; 53 | }; 54 | 55 | row.tableViewConfigureCellForRowAtIndexPathBlock = ^(UITableView *tableView, UITableViewCell *cell, NSIndexPath *indexPath) { 56 | Example2TableViewCell *exampleCell = (Example2TableViewCell *)cell; 57 | 58 | NSMutableArray *textComponents = [NSMutableArray new]; 59 | [textComponents addObject:[NSString stringWithFormat:@"%ld.", (long)indexPath.row+1]]; 60 | for (int i=0; i<=indexPath.row; i++) { 61 | [textComponents addObject:@"Lorem ipsum dolor sit amet."]; 62 | } 63 | exampleCell.exampleLabel.text = [textComponents componentsJoinedByString:@" "]; 64 | }; 65 | }]; 66 | 67 | DRTableViewGenericSectionsController *sectionsController = [[DRTableViewGenericSectionsController alloc] init]; 68 | sectionsController.sectionsArray = @[ 69 | [DRTableViewGenericSection newWithBlock:^(DRTableViewGenericSection *section) { 70 | section.tableViewNumberOfRowsInSectionBlock = ^NSInteger(UITableView *tableView, NSInteger tableViewSection) { 71 | return 20; 72 | }; 73 | section.rowAtIndexBlock = ^NSObject *(NSInteger rowIndex) { 74 | return textRow; 75 | }; 76 | }] 77 | ]; 78 | 79 | _tableViewManager = [[DRTableViewManager alloc] initWithSectionsController:sectionsController]; 80 | _tableViewManager.automaticRowHeightResolvingType = DRTableViewResolveAutomaticRowHeightManually; 81 | } 82 | 83 | return _tableViewManager; 84 | } 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /DRTableViewManager/DRTableViewRow.h: -------------------------------------------------------------------------------- 1 | // 2 | // DRTableViewRow.h 3 | // DRTableViewManager 4 | // 5 | // Created by Dariusz Rybicki on 02/03/15. 6 | // Copyright (c) 2015 Darrarski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DRTableViewManager; 12 | 13 | @protocol DRTableViewRow 14 | 15 | @required 16 | 17 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath; 18 | 19 | @optional 20 | 21 | - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath; 22 | - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath; 23 | - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath; 24 | - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath; 25 | - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; 26 | - (void)tableView:(UITableView *)tableView didEndDisplayingCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath*)indexPath NS_AVAILABLE_IOS(6_0); 27 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath; 28 | - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath NS_AVAILABLE_IOS(7_0); 29 | - (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath; 30 | - (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath NS_AVAILABLE_IOS(6_0); 31 | - (void)tableView:(UITableView *)tableView didHighlightRowAtIndexPath:(NSIndexPath *)indexPath NS_AVAILABLE_IOS(6_0); 32 | - (void)tableView:(UITableView *)tableView didUnhighlightRowAtIndexPath:(NSIndexPath *)indexPath NS_AVAILABLE_IOS(6_0); 33 | - (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath; 34 | - (NSIndexPath *)tableView:(UITableView *)tableView willDeselectRowAtIndexPath:(NSIndexPath *)indexPath NS_AVAILABLE_IOS(3_0); 35 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath; 36 | - (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath NS_AVAILABLE_IOS(3_0); 37 | - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath; 38 | - (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath NS_AVAILABLE_IOS(3_0); 39 | - (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath NS_AVAILABLE_IOS(8_0); 40 | - (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath; 41 | - (void)tableView:(UITableView*)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath; 42 | - (void)tableView:(UITableView*)tableView didEndEditingRowAtIndexPath:(NSIndexPath *)indexPath; 43 | - (NSIndexPath *)tableView:(UITableView *)tableView targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath toProposedIndexPath:(NSIndexPath *)proposedDestinationIndexPath; 44 | - (NSInteger)tableView:(UITableView *)tableView indentationLevelForRowAtIndexPath:(NSIndexPath *)indexPath; 45 | - (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath NS_AVAILABLE_IOS(5_0); 46 | - (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender NS_AVAILABLE_IOS(5_0); 47 | - (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender NS_AVAILABLE_IOS(5_0); 48 | 49 | - (UITableViewCell *)tableViewManager:(DRTableViewManager *)tableViewManager tableView:(UITableView *)tableView cellForComputingRowHeightAtIndexPath:(NSIndexPath *)indexPath; 50 | - (void)tableView:(UITableView *)tableView configureCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /DRTableViewManager/DRTableViewGenericRow.h: -------------------------------------------------------------------------------- 1 | // 2 | // DRTableViewGenericRow.h 3 | // DRTableViewManager 4 | // 5 | // Created by Dariusz Rybicki on 02/03/15. 6 | // Copyright (c) 2015 Darrarski. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DRTableViewRow.h" 11 | 12 | @class DRTableViewManager; 13 | 14 | @interface DRTableViewGenericRow : NSObject 15 | 16 | @property (nonatomic, copy) UITableViewCell *(^tableViewCellForRowAtIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath); 17 | @property (nonatomic, copy) BOOL (^tableViewCanEditRowAtIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath); 18 | @property (nonatomic, copy) BOOL (^tableViewCanMoveRowAtIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath); 19 | @property (nonatomic, copy) void (^tableViewCommitEditingStyleForRowAtIndexPathBlock)(UITableView *tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath *indexPath); 20 | @property (nonatomic, copy) void (^tableViewMoveRowAtIndexPathToIndexPathBlock)(UITableView *tableView, NSIndexPath *sourceIndexPath, NSIndexPath *destinationIndexPath); 21 | @property (nonatomic, copy) void (^tableViewWillDisplayCellForRowAtIndexPathBlock)(UITableView *tableView, UITableViewCell *cell, NSIndexPath *indexPath); 22 | @property (nonatomic, copy) void (^tableViewDidEndDisplayingCellForRowAtIndexPathBlock)(UITableView *tableView, UITableViewCell *cell, NSIndexPath *indexPath); 23 | @property (nonatomic, copy) CGFloat (^tableViewHeightForRowAtIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath); 24 | @property (nonatomic, copy) CGFloat (^tableViewEstimatedHeightForRowAtIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath); 25 | @property (nonatomic, copy) void (^tableViewAccessoryButtonTappedForRowWithIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath); 26 | @property (nonatomic, copy) BOOL (^tableViewShouldHighlightRowAtIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath); 27 | @property (nonatomic, copy) void (^tableViewDidHighlightRowAtIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath); 28 | @property (nonatomic, copy) void (^tableViewDidUnhighlightRowAtIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath); 29 | @property (nonatomic, copy) NSIndexPath *(^tableViewWillSelectRowAtIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath); 30 | @property (nonatomic, copy) NSIndexPath *(^tableViewWillDeselectRowAtIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath); 31 | @property (nonatomic, copy) void (^tableViewDidSelectRowAtIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath); 32 | @property (nonatomic, copy) void (^tableViewDidDeselectRowAtIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath); 33 | @property (nonatomic, copy) UITableViewCellEditingStyle (^tableViewEditingStyleForRowAtIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath); 34 | @property (nonatomic, copy) NSString *(^tableViewTitleForDeleteConfirmationButtonForRowAtIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath); 35 | @property (nonatomic, copy) NSArray *(^tableViewEditActionsForRowAtIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath); 36 | @property (nonatomic, copy) BOOL (^tableViewShouldIndentWhileEditingRowAtIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath); 37 | @property (nonatomic, copy) void (^tableViewWillBeginEditingRowAtIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath); 38 | @property (nonatomic, copy) void (^tableViewDidEndEditingRowAtIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath); 39 | @property (nonatomic, copy) NSIndexPath *(^tableViewTargetIndexPathForMoveFromRowAtIndexPathToProposedIndexPathBlock)(UITableView *tableView, NSIndexPath *sourceIndexPath, NSIndexPath *proposedDestinationIndexPath); 40 | @property (nonatomic, copy) NSInteger (^tableViewIndentationLevelForRowAtIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath); 41 | @property (nonatomic, copy) BOOL (^tableViewShouldShowMenuForRowAtIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath); 42 | @property (nonatomic, copy) BOOL (^tableViewCanPerformActionForRowAtIndexPathWithSenderBlock)(UITableView *tableView, SEL action, NSIndexPath *indexPath, id sender); 43 | @property (nonatomic, copy) BOOL (^tableViewPerformActionForRowAtIndexPathWithSenderBlock)(UITableView *tableView, SEL action, NSIndexPath *indexPath, id sender); 44 | 45 | @property (nonatomic, copy) UITableViewCell *(^tableViewManagerTableViewCellForComputingRowHeightAtIndexPathBlock)(DRTableViewManager *tableViewManager, UITableView * tableView, NSIndexPath *indexPath); 46 | @property (nonatomic, copy) void (^tableViewConfigureCellForRowAtIndexPathBlock)(UITableView *tableView, UITableViewCell *cell, NSIndexPath *indexPath); 47 | 48 | + (instancetype)newWithBlock:(void (^)(DRTableViewGenericRow *))block; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /DRTableViewManagerExample.xcodeproj/xcshareddata/xcschemes/DRTableViewManagerExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /DRTableViewManager/DRTableViewGenericSection.m: -------------------------------------------------------------------------------- 1 | // 2 | // DRTableViewGenericSection.m 3 | // DRTableViewManager 4 | // 5 | // Created by Dariusz Rybicki on 02/03/15. 6 | // Copyright (c) 2015 Darrarski. All rights reserved. 7 | // 8 | 9 | #import "DRTableViewGenericSection.h" 10 | 11 | @implementation DRTableViewGenericSection 12 | 13 | + (instancetype)newWithBlock:(void (^)(DRTableViewGenericSection *section))block 14 | { 15 | return [[self alloc] initWithBlock:block]; 16 | } 17 | 18 | - (instancetype)initWithBlock:(void (^)(DRTableViewGenericSection *section))block 19 | { 20 | self = [super init]; 21 | if (self) { 22 | block(self); 23 | } 24 | return self; 25 | } 26 | 27 | - (NSArray *)rowsArray 28 | { 29 | if (_rowsArray == nil) { 30 | _rowsArray = @[]; 31 | } 32 | 33 | return _rowsArray; 34 | } 35 | 36 | - (BOOL)respondsToSelector:(SEL)aSelector 37 | { 38 | if (aSelector == @selector(tableView:titleForHeaderInSection:) && _tableViewTitleForHeaderInSectionBlock == nil) { 39 | return NO; 40 | } 41 | 42 | if (aSelector == @selector(tableView:titleForFooterInSection:) && _tableViewTitleForFooterInSectionBlock == nil) { 43 | return NO; 44 | } 45 | 46 | if (aSelector == @selector(tableView:heightForHeaderInSection:) && _tableViewHeightForHeaderInSectionBlock == nil) { 47 | return NO; 48 | } 49 | 50 | if (aSelector == @selector(tableView:heightForFooterInSection:) && _tableViewHeightForFooterInSectionBlock == nil) { 51 | return NO; 52 | } 53 | 54 | if (aSelector == @selector(tableView:estimatedHeightForHeaderInSection:) && _tableViewEstimatedHeightForHeaderInSectionBlock == nil) { 55 | return NO; 56 | } 57 | 58 | if (aSelector == @selector(tableView:estimatedHeightForFooterInSection:) && _tableViewEstimatedHeightForFooterInSectionBlock == nil) { 59 | return NO; 60 | } 61 | 62 | if (aSelector == @selector(tableView:viewForHeaderInSection:) && _tableViewViewForHeaderInSectionBlock == nil) { 63 | return NO; 64 | } 65 | 66 | if (aSelector == @selector(tableView:viewForFooterInSection:) && _tableViewViewForFooterInSectionBlock == nil) { 67 | return NO; 68 | } 69 | 70 | if (aSelector == @selector(tableView:willDisplayHeaderView:forSection:) && _tableViewWillDisplayHeaderViewForSectionBlock == nil) { 71 | return NO; 72 | } 73 | 74 | if (aSelector == @selector(tableView:willDisplayFooterView:forSection:) && _tableViewWillDisplayFooterViewForSectionBlock == nil) { 75 | return NO; 76 | } 77 | 78 | if (aSelector == @selector(tableView:didEndDisplayingHeaderView:forSection:) && _tableViewDidEndDisplayingHeaderViewForSectionBlock == nil) { 79 | return NO; 80 | } 81 | 82 | if (aSelector == @selector(tableView:didEndDisplayingFooterView:forSection:) && _tableViewDidEndDisplayingFooterViewForSectionBlock == nil) { 83 | return NO; 84 | } 85 | 86 | return [super respondsToSelector:aSelector]; 87 | } 88 | 89 | #pragma mark - DRTableViewSection 90 | 91 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 92 | { 93 | if (_tableViewNumberOfRowsInSectionBlock != nil) { 94 | return _tableViewNumberOfRowsInSectionBlock(tableView, section); 95 | } 96 | 97 | return [self.rowsArray count]; 98 | } 99 | 100 | - (NSObject *)rowAtIndex:(NSInteger)index 101 | { 102 | if (_rowAtIndexBlock != nil) { 103 | return _rowAtIndexBlock(index); 104 | } 105 | 106 | return self.rowsArray[(NSUInteger)index]; 107 | } 108 | 109 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section 110 | { 111 | return _tableViewTitleForHeaderInSectionBlock(tableView, section); 112 | } 113 | 114 | - (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section 115 | { 116 | return _tableViewTitleForFooterInSectionBlock(tableView, section); 117 | } 118 | 119 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section 120 | { 121 | return _tableViewHeightForHeaderInSectionBlock(tableView, section); 122 | } 123 | 124 | - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section 125 | { 126 | return _tableViewHeightForFooterInSectionBlock(tableView, section); 127 | } 128 | 129 | - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForHeaderInSection:(NSInteger)section 130 | { 131 | return _tableViewEstimatedHeightForHeaderInSectionBlock(tableView, section); 132 | } 133 | 134 | - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForFooterInSection:(NSInteger)section 135 | { 136 | return _tableViewEstimatedHeightForFooterInSectionBlock(tableView, section); 137 | } 138 | 139 | - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section 140 | { 141 | return _tableViewViewForHeaderInSectionBlock(tableView, section); 142 | } 143 | 144 | - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section 145 | { 146 | return _tableViewViewForFooterInSectionBlock(tableView, section); 147 | } 148 | 149 | - (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section 150 | { 151 | _tableViewWillDisplayHeaderViewForSectionBlock(tableView, view, section); 152 | } 153 | 154 | - (void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)section 155 | { 156 | _tableViewWillDisplayFooterViewForSectionBlock(tableView, view, section); 157 | } 158 | 159 | - (void)tableView:(UITableView *)tableView didEndDisplayingHeaderView:(UIView *)view forSection:(NSInteger)section 160 | { 161 | _tableViewDidEndDisplayingHeaderViewForSectionBlock(tableView, view, section); 162 | } 163 | 164 | - (void)tableView:(UITableView *)tableView didEndDisplayingFooterView:(UIView *)view forSection:(NSInteger)section 165 | { 166 | _tableViewDidEndDisplayingFooterViewForSectionBlock(tableView, view, section); 167 | } 168 | 169 | @end 170 | -------------------------------------------------------------------------------- /DRTableViewManagerExample/UI/Example 1/Example1ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // Example1ViewController.m 3 | // DRTableViewManagerExample 4 | // 5 | // Created by Dariusz Rybicki on 02/03/15. 6 | // Copyright (c) 2015 Darrarski. All rights reserved. 7 | // 8 | 9 | #import "Example1ViewController.h" 10 | #import "DRTableViewManager.h" 11 | #import "DRTableViewGenericSectionsController.h" 12 | #import "DRTableViewGenericSection.h" 13 | #import "DRTableViewGenericRow.h" 14 | 15 | @interface Example1ViewController () 16 | 17 | @property (nonatomic, strong) DRTableViewManager *tableViewManager; 18 | 19 | @end 20 | 21 | @implementation Example1ViewController 22 | 23 | - (void)viewDidLoad 24 | { 25 | [super viewDidLoad]; 26 | 27 | self.tableView.rowHeight = 44; 28 | self.tableView.estimatedRowHeight = 44; 29 | self.tableView.sectionHeaderHeight = 30; 30 | self.tableView.estimatedSectionHeaderHeight = 30; 31 | 32 | [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"]; 33 | [self.tableViewManager registerInTableView:self.tableView]; 34 | } 35 | 36 | - (DRTableViewManager *)tableViewManager 37 | { 38 | if (_tableViewManager == nil) { 39 | DRTableViewGenericSectionsController *sectionsController = [[DRTableViewGenericSectionsController alloc] init]; 40 | sectionsController.sectionsArray = @[ 41 | [DRTableViewGenericSection newWithBlock:^(DRTableViewGenericSection *section) { 42 | section.tableViewTitleForHeaderInSectionBlock = ^NSString *(UITableView *tableView, NSInteger sectionIndex) { 43 | return @"Section 1"; 44 | }; 45 | section.rowsArray = @[ 46 | [DRTableViewGenericRow newWithBlock:^(DRTableViewGenericRow *row) { 47 | row.tableViewCellForRowAtIndexPathBlock = ^UITableViewCell *(UITableView *tableView, NSIndexPath *indexPath) { 48 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath]; 49 | cell.textLabel.text = @"Static row 1"; 50 | return cell; 51 | }; 52 | }], 53 | [DRTableViewGenericRow newWithBlock:^(DRTableViewGenericRow *row) { 54 | row.tableViewCellForRowAtIndexPathBlock = ^UITableViewCell *(UITableView *tableView, NSIndexPath *indexPath) { 55 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath]; 56 | cell.textLabel.text = @"Static row 2"; 57 | return cell; 58 | }; 59 | }], 60 | [DRTableViewGenericRow newWithBlock:^(DRTableViewGenericRow *row) { 61 | row.tableViewCellForRowAtIndexPathBlock = ^UITableViewCell *(UITableView *tableView, NSIndexPath *indexPath) { 62 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath]; 63 | cell.textLabel.text = @"Static row 3"; 64 | return cell; 65 | }; 66 | }] 67 | ]; 68 | }], 69 | [DRTableViewGenericSection newWithBlock:^(DRTableViewGenericSection *section) { 70 | section.tableViewTitleForHeaderInSectionBlock = ^NSString *(UITableView *tableView, NSInteger sectionIndex) { 71 | return @"Section 2"; 72 | }; 73 | section.rowsArray = @[ 74 | [DRTableViewGenericRow newWithBlock:^(DRTableViewGenericRow *row) { 75 | row.tableViewCellForRowAtIndexPathBlock = ^UITableViewCell *(UITableView *tableView, NSIndexPath *indexPath) { 76 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath]; 77 | cell.textLabel.text = @"Static row 4"; 78 | return cell; 79 | }; 80 | }], 81 | [DRTableViewGenericRow newWithBlock:^(DRTableViewGenericRow *row) { 82 | row.tableViewCellForRowAtIndexPathBlock = ^UITableViewCell *(UITableView *tableView, NSIndexPath *indexPath) { 83 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath]; 84 | cell.textLabel.text = @"Static row 5"; 85 | return cell; 86 | }; 87 | }], 88 | [DRTableViewGenericRow newWithBlock:^(DRTableViewGenericRow *row) { 89 | row.tableViewCellForRowAtIndexPathBlock = ^UITableViewCell *(UITableView *tableView, NSIndexPath *indexPath) { 90 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath]; 91 | cell.textLabel.text = @"Static row 6"; 92 | return cell; 93 | }; 94 | }], 95 | [DRTableViewGenericRow newWithBlock:^(DRTableViewGenericRow *row) { 96 | row.tableViewCellForRowAtIndexPathBlock = ^UITableViewCell *(UITableView *tableView, NSIndexPath *indexPath) { 97 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath]; 98 | cell.textLabel.text = @"Static row 7"; 99 | return cell; 100 | }; 101 | }] 102 | ]; 103 | }], 104 | [DRTableViewGenericSection newWithBlock:^(DRTableViewGenericSection *section) { 105 | section.tableViewTitleForHeaderInSectionBlock = ^NSString *(UITableView *tableView, NSInteger sectionIndex) { 106 | return @"Section 3"; 107 | }; 108 | section.tableViewNumberOfRowsInSectionBlock = ^NSInteger(UITableView *tableView, NSInteger sectionIndex) { 109 | return 10; 110 | }; 111 | section.rowAtIndexBlock = ^NSObject *(NSInteger index) { 112 | return [DRTableViewGenericRow newWithBlock:^(DRTableViewGenericRow *row) { 113 | row.tableViewCellForRowAtIndexPathBlock = ^UITableViewCell *(UITableView *tableView, NSIndexPath *indexPath) { 114 | return [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath]; 115 | }; 116 | row.tableViewConfigureCellForRowAtIndexPathBlock = ^(UITableView *tableView, UITableViewCell *cell, NSIndexPath *indexPath) { 117 | cell.textLabel.text = [NSString stringWithFormat:@"Dynamic row (%ld.%ld)", (long)indexPath.section+1, (long)indexPath.row+1]; 118 | }; 119 | }]; 120 | }; 121 | }] 122 | ]; 123 | 124 | _tableViewManager = [[DRTableViewManager alloc] initWithSectionsController:sectionsController]; 125 | } 126 | 127 | return _tableViewManager; 128 | } 129 | 130 | @end 131 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DRTableViewManager (iOS) 2 | 3 | > Object-oriented UITableViewDataSource and UITableViewDelegate protocols proxy 4 | 5 | Simple wrapper around `UITableViewDataSource` and `UITableViewDelegate` protocols that allows easy `UITableView` content configuration using blocks or custom objects representing sections and rows. 6 | 7 | General logic behind `DRTableViewManager`: 8 | 9 | - `DRTableViewManager` - implements `UITableViewDataSource` and `UITableViewDelegate` protocols, owns `DRTableViewSectionController` 10 | - `DRTableViewSectionController` - defines sections (`DRTableViewSection`) for given table view 11 | - `DRTableViewSection` - represents table view section; defines rows (`DRTableViewRow`) for that section; implements sections-connected part of `UITableViewDataSource` and `UITableViewDelegate` protocols 12 | - `DRTableViewRow` - represents table view row; defines cell (`UITableViewCell`) for that row; implements rows-connected part of `UITableViewDataSource` and `UITableViewDelegate` protocols 13 | 14 | ![DRTableViewManager graph](Misc/graph.png "DRTableViewManager graph") 15 | 16 | Full `UITableViewDataSource` and `UITableViewDelegate` protocols are supported. For example, `DRTableViewSection` also defines section's header and footer (as well as their heights), and `DRTableViewRow` defines `UITableViewCell` height, didSelect action etc. 17 | 18 | In addition, `DRTableViewManager` was designed to allow using `UITableViewAutomaticDimension` cell height on iOS 7. Behaviour for resolving automatic cell height can be configured by setting `automaticRowHeightResolvingType` property on `DRTableViewManager` object. `DRTableViewAutomaticRowHeightResolvingType` has three available options: 19 | 20 | - `DRTableViewResolveAutomaticRowHeightAutomatically` - row height will be computed by iOS automatically using `UITableViewAutomaticDimension` (available only on iOS 8). 21 | - `DRTableViewResolveAutomaticRowHeightManually` - row height will be computed by resolving AutoLayout on cell. It will be handled automatically by `DRTableViewManager` if `tableViewCellForComputingRowHeightAtIndexPathBlock` is set for row. 22 | - `DRTableViewResolveAutomaticRowHeightAutomaticallyIfAvailable` (default value) - `UITableViewAutomaticDimension` will be used if availabe, otherwise height will be resolved like when using `DRTableViewResolveAutomaticRowHeightManually` option. 23 | 24 | If you are using UIKit elements that requires setting `preferredMaxLayoutWidth` to layout properly, use `DRTableViewResolveAutomaticRowHeightManually` option to avoid issues on different iOS versions. See Example 2 for more details. 25 | 26 | 27 | ## Instalation 28 | 29 | You can integrate `DRTableViewManager` with your project using CocoaPods. To do so, you will need to add one of the following lines to your Podfile: 30 | 31 | For stable release (recommended): 32 | 33 | pod 'DRTableViewManager', '~> 1.0.13' 34 | 35 | Which creates dependecy for version `>= 1.0.13` and `< 1.1` 36 | 37 | You can also download zip archive of given release from [releases page](https://github.com/darrarski/DRTableViewManager-iOS/releases). 38 | 39 | ## Usage 40 | 41 | Check out included example project or `TableViewDemo` in its own [reposotory](https://github.com/darrarski/TableViewDemo). 42 | 43 | ### Example 1 44 | 45 | Shows basic usage, where sections and cells are statically defined in arrays. 46 | 47 | ### Example 2 48 | 49 | Shows basic usage as well, but configures automatic cell heights basing on their content. Works for both iOS 8 (using native `UITableViewAutomaticDimension`) and iOS 7 (computes height with AutoLayout - see source code for details). 50 | 51 | ### TL;DR 52 | 53 | Example usage: 54 | 55 | ```objective-c 56 | DRTableViewGenericSectionsController *sectionsController = [[DRTableViewGenericSectionsController alloc] init]; 57 | sectionsController.sectionsCountBlock = ^NSInteger { 58 | return 3; 59 | }; 60 | sectionsController.sectionAtIndexBlock = ^NSObject *(NSInteger sectionIndex) { 61 | return [DRTableViewGenericSection createWithBlock:^(DRTableViewGenericSection *section) { 62 | section.tableViewTitleForHeaderInSectionBlock = ^NSString *(UITableView *tableView, NSInteger tableSectionIndex) { 63 | return [NSString stringWithFormat:@"Section %ld", (long)tableSectionIndex]; 64 | }; 65 | section.tableViewHeightForHeaderInSectionBlock = ^CGFloat(UITableView *tableView, NSInteger tableSectionIndex) { 66 | return 30; 67 | }; 68 | section.tableViewNumberOfRowsInSectionBlock = ^NSInteger(UITableView *tableView, NSInteger tableSectionIndex) { 69 | return 3; 70 | }; 71 | section.rowAtIndexBlock = ^NSObject *(NSInteger rowIndex) { 72 | return [DRTableViewGenericRow createWithBlock:^(DRTableViewGenericRow *row) { 73 | row.tableViewHeightForRowAtIndexPathBlock = ^CGFloat(UITableView *tableView, NSIndexPath *indexPath) { 74 | return 44; 75 | }; 76 | row.tableViewCellForRowAtIndexPathBlock = ^UITableViewCell *(UITableView *tableView, NSIndexPath *indexPath) { 77 | UITableViewCell *cell = [[UITableViewCell alloc] init]; 78 | cell.textLabel.text = [NSString stringWithFormat:@"Row %ld", (long)indexPath.row]; 79 | return cell; 80 | }; 81 | }]; 82 | }; 83 | }]; 84 | }; 85 | _tableViewManager = [[DRTableViewManager alloc] initWithSectionsController:sectionsController]; 86 | [_tableViewManager registerInTableView:self.tableView]; 87 | ``` 88 | 89 | ## Changelog 90 | 91 | ##### v1.0.13 92 | 93 | > Fixed issue with manually computed row height on iOS 9 94 | 95 | ##### v1.0.12 96 | 97 | > Added `scrollViewDelegate` (``) property to `DRTableViewManager` 98 | 99 | ##### v1.0.11 100 | 101 | > Added helper methods to `DRTableViewManager`: 102 | > 103 | > - `rowForCell:atIndexPath:` 104 | > - `sectionForFooterHeaderView:atIndex:` 105 | 106 | ##### v1.0.10 107 | 108 | > Fixed import statements in header files 109 | 110 | ##### v1.0.9 111 | 112 | > `DRTableViewManager` updated, added `sectionAtIndex:` and `rowAtIndexPath:` methods 113 | 114 | ##### v1.0.8 115 | 116 | > `DRTableViewGenericRow` and `DRTableViewGenericSection` initialization adjusted to common patters, builder method renamed from `createWithBlock:` to `newWithBlock:` 117 | 118 | ##### v1.0.7 119 | 120 | > Added cells cache to `DRTableViewManager`, useful for caching cells used for computing row height 121 | 122 | > Examples updated 123 | 124 | ##### v1.0.6 125 | 126 | > Added `automaticRowHeightResolvingType` property to `DRTableViewManager` 127 | 128 | > Examples updated 129 | 130 | ##### v1.0.5 131 | 132 | > Added `tableView:cellForComputingRowHeightAtIndexPath:` method to `DRTableViewRow` protocol for supporting `UITableViewAutomaticDimension` cell height under iOS 7 133 | 134 | > Added `tableView:configureCell:forRowAtIndexPath:` method to `DRTableViewRow` protocol 135 | 136 | > Examples updated 137 | 138 | ##### v1.0.4 139 | 140 | > Deployment target changed to iOS 7.0, `DRTableViewManager` is compatible with both iOS 7 and iOS 8. 141 | 142 | > Added Example 2 that shows how to implement automatic cell heights that works natively on iOS 8, but also on iOS 7 with some additional code. 143 | 144 | ##### v1.0.3 145 | 146 | > Fixed - wrong method called on `DRTableViewRow` object for `tableView:heightForRowAtIndexPath:` method from `UITableViewDelegate` protocol 147 | 148 | ##### v1.0.2 149 | 150 | > Fixed invalid protocol compliance definitions for arrays 151 | 152 | ##### v1.0.1 153 | 154 | > Minor fixes 155 | 156 | ##### v1.0.0 157 | 158 | > Inital release, supports iOS 8 159 | 160 | ## License 161 | 162 | The MIT License (MIT) - check out included [LICENSE](LICENSE) file 163 | 164 | -------------------------------------------------------------------------------- /DRTableViewManagerExample/UI/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 | 84 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 107 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /DRTableViewManager/DRTableViewGenericRow.m: -------------------------------------------------------------------------------- 1 | // 2 | // DRTableViewGenericRow.m 3 | // DRTableViewManager 4 | // 5 | // Created by Dariusz Rybicki on 02/03/15. 6 | // Copyright (c) 2015 Darrarski. All rights reserved. 7 | // 8 | 9 | #import "DRTableViewGenericRow.h" 10 | 11 | @implementation DRTableViewGenericRow 12 | 13 | + (instancetype)newWithBlock:(void (^)(DRTableViewGenericRow *))block 14 | { 15 | return [[self alloc] initWithBlock:block]; 16 | } 17 | 18 | - (instancetype)initWithBlock:(void (^)(DRTableViewGenericRow *))block 19 | { 20 | self = [super init]; 21 | if (self) { 22 | block(self); 23 | } 24 | return self; 25 | } 26 | 27 | - (BOOL)respondsToSelector:(SEL)aSelector 28 | { 29 | if (aSelector == @selector(tableView:heightForRowAtIndexPath:) && _tableViewHeightForRowAtIndexPathBlock == nil) { 30 | return NO; 31 | } 32 | 33 | if (aSelector == @selector(tableView:estimatedHeightForRowAtIndexPath:) && _tableViewEstimatedHeightForRowAtIndexPathBlock == nil) { 34 | return NO; 35 | } 36 | 37 | if (aSelector == @selector(tableView:accessoryButtonTappedForRowWithIndexPath:) && _tableViewAccessoryButtonTappedForRowWithIndexPathBlock == nil) { 38 | return NO; 39 | } 40 | 41 | if (aSelector == @selector(tableView:shouldHighlightRowAtIndexPath:) && _tableViewShouldHighlightRowAtIndexPathBlock == nil) { 42 | return NO; 43 | } 44 | 45 | if (aSelector == @selector(tableView:didHighlightRowAtIndexPath:) && _tableViewDidHighlightRowAtIndexPathBlock == nil) { 46 | return NO; 47 | } 48 | 49 | if (aSelector == @selector(tableView:didUnhighlightRowAtIndexPath:) && _tableViewDidUnhighlightRowAtIndexPathBlock == nil) { 50 | return NO; 51 | } 52 | 53 | if (aSelector == @selector(tableView:willSelectRowAtIndexPath:) && _tableViewWillSelectRowAtIndexPathBlock == nil) { 54 | return NO; 55 | } 56 | 57 | if (aSelector == @selector(tableView:willDeselectRowAtIndexPath:) && _tableViewWillDeselectRowAtIndexPathBlock == nil) { 58 | return NO; 59 | } 60 | 61 | if (aSelector == @selector(tableView:didSelectRowAtIndexPath:) && _tableViewDidSelectRowAtIndexPathBlock == nil) { 62 | return NO; 63 | } 64 | 65 | if (aSelector == @selector(tableView:didDeselectRowAtIndexPath:) && _tableViewDidDeselectRowAtIndexPathBlock == nil) { 66 | return NO; 67 | } 68 | 69 | if (aSelector == @selector(tableView:canEditRowAtIndexPath:) && _tableViewCanEditRowAtIndexPathBlock == nil) { 70 | return NO; 71 | } 72 | 73 | if (aSelector == @selector(tableView:canMoveRowAtIndexPath:) && _tableViewCanMoveRowAtIndexPathBlock == nil) { 74 | return NO; 75 | } 76 | 77 | if (aSelector == @selector(tableView:moveRowAtIndexPath:toIndexPath:) && _tableViewMoveRowAtIndexPathToIndexPathBlock == nil) { 78 | return NO; 79 | } 80 | 81 | if (aSelector == @selector(tableView:editingStyleForRowAtIndexPath:) && _tableViewEditingStyleForRowAtIndexPathBlock == nil) { 82 | return NO; 83 | } 84 | 85 | if (aSelector == @selector(tableView:titleForDeleteConfirmationButtonForRowAtIndexPath:) && _tableViewTitleForDeleteConfirmationButtonForRowAtIndexPathBlock == nil) { 86 | return NO; 87 | } 88 | 89 | if (aSelector == @selector(tableView:editActionsForRowAtIndexPath:) && _tableViewEditActionsForRowAtIndexPathBlock == nil) { 90 | return NO; 91 | } 92 | 93 | if (aSelector == @selector(tableView:shouldIndentWhileEditingRowAtIndexPath:) && _tableViewShouldIndentWhileEditingRowAtIndexPathBlock == nil) { 94 | return NO; 95 | } 96 | 97 | if (aSelector == @selector(tableView:willBeginEditingRowAtIndexPath:) && _tableViewWillBeginEditingRowAtIndexPathBlock == nil) { 98 | return NO; 99 | } 100 | 101 | if (aSelector == @selector(tableView:didEndEditingRowAtIndexPath:) && _tableViewDidEndEditingRowAtIndexPathBlock == nil) { 102 | return NO; 103 | } 104 | 105 | if (aSelector == @selector(tableView:indentationLevelForRowAtIndexPath:) && _tableViewIndentationLevelForRowAtIndexPathBlock == nil) { 106 | return NO; 107 | } 108 | 109 | if (aSelector == @selector(tableView:shouldShowMenuForRowAtIndexPath:) && _tableViewShouldShowMenuForRowAtIndexPathBlock == nil) { 110 | return NO; 111 | } 112 | 113 | if (aSelector == @selector(tableView:canPerformAction:forRowAtIndexPath:withSender:) && _tableViewCanPerformActionForRowAtIndexPathWithSenderBlock == nil) { 114 | return NO; 115 | } 116 | 117 | if (aSelector == @selector(tableView:performAction:forRowAtIndexPath:withSender:) && _tableViewPerformActionForRowAtIndexPathWithSenderBlock == nil) { 118 | return NO; 119 | } 120 | 121 | if (aSelector == @selector(tableView:targetIndexPathForMoveFromRowAtIndexPath:toProposedIndexPath:) && _tableViewTargetIndexPathForMoveFromRowAtIndexPathToProposedIndexPathBlock == nil) { 122 | return NO; 123 | } 124 | 125 | if (aSelector == @selector(tableView:willDisplayCell:forRowAtIndexPath:) && _tableViewWillDisplayCellForRowAtIndexPathBlock == nil) { 126 | return NO; 127 | } 128 | 129 | if (aSelector == @selector(tableView:didEndDisplayingCell:forRowAtIndexPath:) && _tableViewDidEndDisplayingCellForRowAtIndexPathBlock == nil) { 130 | return NO; 131 | } 132 | 133 | if (aSelector == @selector(tableView:commitEditingStyle:forRowAtIndexPath:) && _tableViewCommitEditingStyleForRowAtIndexPathBlock == nil) { 134 | return NO; 135 | } 136 | 137 | if (aSelector == @selector(tableViewManager:tableView:cellForComputingRowHeightAtIndexPath:) && _tableViewManagerTableViewCellForComputingRowHeightAtIndexPathBlock == nil) { 138 | return NO; 139 | } 140 | 141 | if (aSelector == @selector(tableView:configureCell:forRowAtIndexPath:) && _tableViewConfigureCellForRowAtIndexPathBlock == nil) { 142 | return NO; 143 | } 144 | 145 | return [super respondsToSelector:aSelector]; 146 | } 147 | 148 | #pragma mark - DRTableViewRow 149 | 150 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 151 | { 152 | return _tableViewCellForRowAtIndexPathBlock(tableView, indexPath); 153 | } 154 | 155 | - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath 156 | { 157 | return _tableViewCanEditRowAtIndexPathBlock(tableView, indexPath); 158 | } 159 | 160 | - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath 161 | { 162 | return _tableViewCanMoveRowAtIndexPathBlock(tableView, indexPath); 163 | } 164 | 165 | - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath 166 | { 167 | _tableViewCommitEditingStyleForRowAtIndexPathBlock(tableView, editingStyle, indexPath); 168 | } 169 | 170 | - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath 171 | { 172 | _tableViewMoveRowAtIndexPathToIndexPathBlock(tableView, sourceIndexPath, destinationIndexPath); 173 | } 174 | 175 | - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath 176 | { 177 | _tableViewWillDisplayCellForRowAtIndexPathBlock(tableView, cell, indexPath); 178 | } 179 | 180 | - (void)tableView:(UITableView *)tableView didEndDisplayingCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath*)indexPath 181 | { 182 | _tableViewDidEndDisplayingCellForRowAtIndexPathBlock(tableView, cell, indexPath); 183 | } 184 | 185 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 186 | { 187 | return _tableViewHeightForRowAtIndexPathBlock(tableView, indexPath); 188 | } 189 | 190 | - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath 191 | { 192 | return _tableViewEstimatedHeightForRowAtIndexPathBlock(tableView, indexPath); 193 | } 194 | 195 | - (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath 196 | { 197 | _tableViewAccessoryButtonTappedForRowWithIndexPathBlock(tableView, indexPath); 198 | } 199 | 200 | - (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath 201 | { 202 | return _tableViewShouldHighlightRowAtIndexPathBlock(tableView, indexPath); 203 | } 204 | 205 | - (void)tableView:(UITableView *)tableView didHighlightRowAtIndexPath:(NSIndexPath *)indexPath 206 | { 207 | _tableViewDidHighlightRowAtIndexPathBlock(tableView, indexPath); 208 | } 209 | 210 | - (void)tableView:(UITableView *)tableView didUnhighlightRowAtIndexPath:(NSIndexPath *)indexPath 211 | { 212 | _tableViewDidUnhighlightRowAtIndexPathBlock(tableView, indexPath); 213 | } 214 | 215 | - (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath 216 | { 217 | return _tableViewWillSelectRowAtIndexPathBlock(tableView, indexPath); 218 | } 219 | 220 | - (NSIndexPath *)tableView:(UITableView *)tableView willDeselectRowAtIndexPath:(NSIndexPath *)indexPath 221 | { 222 | return _tableViewWillDeselectRowAtIndexPathBlock(tableView, indexPath); 223 | } 224 | 225 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 226 | { 227 | _tableViewDidSelectRowAtIndexPathBlock(tableView, indexPath); 228 | } 229 | 230 | - (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath 231 | { 232 | _tableViewDidDeselectRowAtIndexPathBlock(tableView, indexPath); 233 | } 234 | 235 | - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath 236 | { 237 | return _tableViewEditingStyleForRowAtIndexPathBlock(tableView, indexPath); 238 | } 239 | 240 | - (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath 241 | { 242 | return _tableViewTitleForDeleteConfirmationButtonForRowAtIndexPathBlock(tableView, indexPath); 243 | } 244 | 245 | - (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath 246 | { 247 | return _tableViewEditActionsForRowAtIndexPathBlock(tableView, indexPath); 248 | } 249 | 250 | - (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath 251 | { 252 | return _tableViewShouldIndentWhileEditingRowAtIndexPathBlock(tableView, indexPath); 253 | } 254 | 255 | - (void)tableView:(UITableView*)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath 256 | { 257 | _tableViewWillBeginEditingRowAtIndexPathBlock(tableView, indexPath); 258 | } 259 | 260 | - (void)tableView:(UITableView*)tableView didEndEditingRowAtIndexPath:(NSIndexPath *)indexPath 261 | { 262 | _tableViewDidEndEditingRowAtIndexPathBlock(tableView, indexPath); 263 | } 264 | 265 | - (NSIndexPath *)tableView:(UITableView *)tableView targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath toProposedIndexPath:(NSIndexPath *)proposedDestinationIndexPath 266 | { 267 | return _tableViewTargetIndexPathForMoveFromRowAtIndexPathToProposedIndexPathBlock(tableView, sourceIndexPath, proposedDestinationIndexPath); 268 | } 269 | 270 | - (NSInteger)tableView:(UITableView *)tableView indentationLevelForRowAtIndexPath:(NSIndexPath *)indexPath 271 | { 272 | return _tableViewIndentationLevelForRowAtIndexPathBlock(tableView, indexPath); 273 | } 274 | 275 | - (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath 276 | { 277 | return _tableViewShouldShowMenuForRowAtIndexPathBlock(tableView, indexPath); 278 | } 279 | 280 | - (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender 281 | { 282 | return _tableViewCanPerformActionForRowAtIndexPathWithSenderBlock(tableView, action, indexPath, sender); 283 | } 284 | 285 | - (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender 286 | { 287 | _tableViewPerformActionForRowAtIndexPathWithSenderBlock(tableView, action, indexPath, sender); 288 | } 289 | 290 | - (UITableViewCell *)tableViewManager:(DRTableViewManager *)tableViewManager tableView:(UITableView *)tableView cellForComputingRowHeightAtIndexPath:(NSIndexPath *)indexPath 291 | { 292 | return _tableViewManagerTableViewCellForComputingRowHeightAtIndexPathBlock(tableViewManager, tableView, indexPath); 293 | } 294 | 295 | - (void)tableView:(UITableView *)tableView configureCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath 296 | { 297 | _tableViewConfigureCellForRowAtIndexPathBlock(tableView, cell, indexPath); 298 | } 299 | 300 | @end 301 | -------------------------------------------------------------------------------- /Misc/graph.graphml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | DRTableViewManager 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | <DRTableViewSectionsController> 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | <DRTableViewRow> 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | <DRTableViewSection> 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | UITableView 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | UITableViewCell 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | <UITableViewDataSource> 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | <UITableViewDelegate> 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | UITableViewHeaderFooterView 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | -------------------------------------------------------------------------------- /DRTableViewManager/DRTableViewManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // DRTableViewManager.m 3 | // DRTableViewManager 4 | // 5 | // Created by Dariusz Rybicki on 02/03/15. 6 | // Copyright (c) 2015 Darrarski. All rights reserved. 7 | // 8 | 9 | #import "DRTableViewManager.h" 10 | #import "DRTableViewSectionsController.h" 11 | #import "DRTableViewSection.h" 12 | #import "DRTableViewRow.h" 13 | 14 | @interface DRTableViewManager () 15 | 16 | @property (nonatomic, strong) NSObject *sectionsController; 17 | @property (nonatomic, strong) NSMutableDictionary *cachedCells; 18 | 19 | @end 20 | 21 | @implementation DRTableViewManager 22 | 23 | - (instancetype)init 24 | { 25 | if (self = [super init]) { 26 | _automaticRowHeightResolvingType = DRTableViewResolveAutomaticRowHeightAutomaticallyIfAvailable; 27 | _cachedCells = [NSMutableDictionary new]; 28 | } 29 | return self; 30 | } 31 | 32 | - (instancetype)initWithSectionsController:(NSObject *)sectionsController 33 | { 34 | if (self = [self init]) { 35 | _sectionsController = sectionsController; 36 | } 37 | return self; 38 | } 39 | 40 | - (void)registerInTableView:(UITableView *)tableView 41 | { 42 | tableView.dataSource = self; 43 | tableView.delegate = self; 44 | } 45 | 46 | - (UITableViewCell *)cachedCellForKey:(NSString *)key 47 | { 48 | return self.cachedCells[key]; 49 | } 50 | 51 | - (void)setCachedCell:(UITableViewCell *)cell forKey:(NSString *)key 52 | { 53 | self.cachedCells[key] = cell; 54 | } 55 | 56 | - (id )sectionAtIndex:(NSInteger)sectionIndex 57 | { 58 | return [self.sectionsController sectionAtIndex:sectionIndex]; 59 | } 60 | 61 | - (id )sectionForFooterHeaderView:(UIView *)view atIndex:(NSInteger)sectionIndex 62 | { 63 | return [self sectionAtIndex:sectionIndex]; 64 | } 65 | 66 | - (id )rowAtIndexPath:(NSIndexPath *)indexPath 67 | { 68 | id section = [self sectionAtIndex:indexPath.section]; 69 | return [section rowAtIndex:indexPath.row]; 70 | } 71 | 72 | - (id )rowForCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath 73 | { 74 | return [self rowAtIndexPath:indexPath]; 75 | } 76 | 77 | #pragma mark - Private helpers 78 | 79 | - (BOOL)shouldComputeRowHeightManually 80 | { 81 | switch (self.automaticRowHeightResolvingType) { 82 | case DRTableViewResolveAutomaticRowHeightAutomaticallyIfAvailable: 83 | return floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_7_1; 84 | 85 | case DRTableViewResolveAutomaticRowHeightAutomatically: 86 | return NO; 87 | 88 | case DRTableViewResolveAutomaticRowHeightManually: 89 | return YES; 90 | } 91 | return NO; 92 | } 93 | 94 | #pragma mark - UITableViewDataSource 95 | 96 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 97 | { 98 | return [self.sectionsController sectionsCount]; 99 | } 100 | 101 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 102 | { 103 | return [[self sectionAtIndex:section] tableView:tableView numberOfRowsInSection:section]; 104 | } 105 | 106 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 107 | { 108 | id row = [self rowAtIndexPath:indexPath]; 109 | UITableViewCell *cell = [row tableView:tableView cellForRowAtIndexPath:indexPath]; 110 | if ([row respondsToSelector:@selector(tableView:configureCell:forRowAtIndexPath:)]) { 111 | [row tableView:tableView configureCell:cell forRowAtIndexPath:indexPath]; 112 | } 113 | return cell; 114 | } 115 | 116 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)sectionIndex 117 | { 118 | id section = [self sectionAtIndex:sectionIndex]; 119 | if ([section respondsToSelector:@selector(tableView:titleForHeaderInSection:)]) { 120 | return [section tableView:tableView titleForHeaderInSection:sectionIndex]; 121 | } 122 | return nil; 123 | } 124 | 125 | - (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)sectionIndex 126 | { 127 | id section = [self sectionAtIndex:sectionIndex]; 128 | if ([section respondsToSelector:@selector(tableView:titleForFooterInSection:)]) { 129 | return [section tableView:tableView titleForFooterInSection:sectionIndex]; 130 | } 131 | return nil; 132 | } 133 | 134 | - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath 135 | { 136 | id row = [self rowAtIndexPath:indexPath]; 137 | if ([row respondsToSelector:@selector(tableView:canEditRowAtIndexPath:)]) { 138 | return [row tableView:tableView canEditRowAtIndexPath:indexPath]; 139 | } 140 | return NO; 141 | } 142 | 143 | - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath 144 | { 145 | id row = [self rowAtIndexPath:indexPath]; 146 | if ([row respondsToSelector:@selector(tableView:canMoveRowAtIndexPath:)]) { 147 | return [row tableView:tableView canMoveRowAtIndexPath:indexPath]; 148 | } 149 | return NO; 150 | } 151 | 152 | - (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView 153 | { 154 | if ([self.sectionsController respondsToSelector:@selector(sectionIndexTitlesForTableView:)]) { 155 | return [self.sectionsController sectionIndexTitlesForTableView:tableView]; 156 | } 157 | return nil; 158 | } 159 | 160 | - (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index 161 | { 162 | if ([self.sectionsController respondsToSelector:@selector(tableView:sectionForSectionIndexTitle:atIndex:)]) { 163 | return [self.sectionsController tableView:tableView sectionForSectionIndexTitle:title atIndex:index]; 164 | } 165 | return 0; 166 | } 167 | 168 | - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath 169 | { 170 | id row = [self rowAtIndexPath:indexPath]; 171 | if ([row respondsToSelector:@selector(tableView:commitEditingStyle:forRowAtIndexPath:)]) { 172 | [row tableView:tableView commitEditingStyle:editingStyle forRowAtIndexPath:indexPath]; 173 | } 174 | } 175 | 176 | - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath 177 | { 178 | id row = [self rowAtIndexPath:sourceIndexPath]; 179 | if ([row respondsToSelector:@selector(tableView:moveRowAtIndexPath:toIndexPath:)]) { 180 | [row tableView:tableView moveRowAtIndexPath:sourceIndexPath toIndexPath:destinationIndexPath]; 181 | } 182 | } 183 | 184 | #pragma mark - UITableViewDelegate 185 | 186 | - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath 187 | { 188 | id row = [self rowForCell:cell atIndexPath:indexPath]; 189 | if ([row respondsToSelector:@selector(tableView:willDisplayCell:forRowAtIndexPath:)]) { 190 | [row tableView:tableView willDisplayCell:cell forRowAtIndexPath:indexPath]; 191 | } 192 | } 193 | 194 | - (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)sectionIndex 195 | { 196 | id section = [self sectionForFooterHeaderView:view atIndex:sectionIndex]; 197 | if ([section respondsToSelector:@selector(tableView:willDisplayHeaderView:forSection:)]) { 198 | [section tableView:tableView willDisplayHeaderView:view forSection:sectionIndex]; 199 | } 200 | } 201 | 202 | - (void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)sectionIndex 203 | { 204 | id section = [self sectionForFooterHeaderView:view atIndex:sectionIndex]; 205 | if ([section respondsToSelector:@selector(tableView:willDisplayFooterView:forSection:)]) { 206 | [section tableView:tableView willDisplayFooterView:view forSection:sectionIndex]; 207 | } 208 | } 209 | 210 | - (void)tableView:(UITableView *)tableView didEndDisplayingCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath 211 | { 212 | id row = [self rowForCell:cell atIndexPath:indexPath]; 213 | if ([row respondsToSelector:@selector(tableView:didEndDisplayingCell:forRowAtIndexPath:)]) { 214 | [row tableView:tableView didEndDisplayingCell:cell forRowAtIndexPath:indexPath]; 215 | } 216 | } 217 | 218 | - (void)tableView:(UITableView *)tableView didEndDisplayingHeaderView:(UIView *)view forSection:(NSInteger)sectionIndex 219 | { 220 | id section = [self sectionForFooterHeaderView:view atIndex:sectionIndex]; 221 | if ([section respondsToSelector:@selector(tableView:didEndDisplayingHeaderView:forSection:)]) { 222 | [section tableView:tableView didEndDisplayingHeaderView:view forSection:sectionIndex]; 223 | } 224 | } 225 | 226 | - (void)tableView:(UITableView *)tableView didEndDisplayingFooterView:(UIView *)view forSection:(NSInteger)sectionIndex 227 | { 228 | id section = [self sectionForFooterHeaderView:view atIndex:sectionIndex]; 229 | if ([section respondsToSelector:@selector(tableView:didEndDisplayingFooterView:forSection:)]) { 230 | [section tableView:tableView didEndDisplayingHeaderView:view forSection:sectionIndex]; 231 | } 232 | } 233 | 234 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 235 | { 236 | CGFloat height = tableView.rowHeight; 237 | 238 | id row = [self rowAtIndexPath:indexPath]; 239 | if ([row respondsToSelector:@selector(tableView:heightForRowAtIndexPath:)]) { 240 | height = [row tableView:tableView heightForRowAtIndexPath:indexPath]; 241 | } 242 | 243 | if (height == UITableViewAutomaticDimension && [self shouldComputeRowHeightManually]) { 244 | NSAssert( 245 | [row respondsToSelector:@selector(tableViewManager:tableView:cellForComputingRowHeightAtIndexPath:)], 246 | @"Row object should implement tableViewManager:tableView:cellForComputingRowHeightAtIndexPath: method for using UITableViewAutomaticDimension under iOS 7" 247 | ); 248 | 249 | UITableViewCell *cell = [row tableViewManager:self tableView:tableView cellForComputingRowHeightAtIndexPath:indexPath]; 250 | cell.translatesAutoresizingMaskIntoConstraints = NO; 251 | cell.contentView.translatesAutoresizingMaskIntoConstraints = NO; 252 | 253 | if ([row respondsToSelector:@selector(tableView:configureCell:forRowAtIndexPath:)]) { 254 | [row tableView:tableView configureCell:cell forRowAtIndexPath:indexPath]; 255 | } 256 | 257 | CGRect bounds = cell.bounds; 258 | bounds.size.width = CGRectGetWidth(tableView.frame); 259 | cell.bounds = bounds; 260 | 261 | [cell setNeedsLayout]; 262 | [cell layoutIfNeeded]; 263 | 264 | height = [cell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height + 1.f; 265 | } 266 | 267 | return height; 268 | } 269 | 270 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)sectionIndex 271 | { 272 | id section = [self sectionAtIndex:sectionIndex]; 273 | if ([section respondsToSelector:@selector(tableView:heightForHeaderInSection:)]) { 274 | return [section tableView:tableView heightForHeaderInSection:sectionIndex]; 275 | } 276 | return tableView.sectionHeaderHeight; 277 | } 278 | 279 | - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)sectionIndex 280 | { 281 | id section = [self sectionAtIndex:sectionIndex]; 282 | if ([section respondsToSelector:@selector(tableView:estimatedHeightForFooterInSection:)]) { 283 | return [section tableView:tableView heightForFooterInSection:sectionIndex]; 284 | } 285 | return tableView.sectionFooterHeight; 286 | } 287 | 288 | - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath 289 | { 290 | id row = [self rowAtIndexPath:indexPath]; 291 | if ([row respondsToSelector:@selector(tableView:estimatedHeightForRowAtIndexPath:)]) { 292 | return [row tableView:tableView estimatedHeightForRowAtIndexPath:indexPath]; 293 | } 294 | return tableView.estimatedRowHeight; 295 | } 296 | 297 | - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForHeaderInSection:(NSInteger)sectionIndex 298 | { 299 | id section = [self sectionAtIndex:sectionIndex]; 300 | if ([section respondsToSelector:@selector(tableView:estimatedHeightForHeaderInSection:)]) { 301 | return [section tableView:tableView estimatedHeightForHeaderInSection:sectionIndex]; 302 | } 303 | return tableView.estimatedSectionHeaderHeight; 304 | } 305 | 306 | - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForFooterInSection:(NSInteger)sectionIndex 307 | { 308 | id section = [self sectionAtIndex:sectionIndex]; 309 | if ([section respondsToSelector:@selector(tableView:estimatedHeightForFooterInSection:)]) { 310 | return [section tableView:tableView estimatedHeightForFooterInSection:sectionIndex]; 311 | } 312 | return tableView.estimatedSectionFooterHeight; 313 | } 314 | 315 | - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)sectionIndex 316 | { 317 | id section = [self.sectionsController sectionAtIndex:sectionIndex]; 318 | if ([section respondsToSelector:@selector(tableView:viewForHeaderInSection:)]) { 319 | return [section tableView:tableView viewForHeaderInSection:sectionIndex]; 320 | } 321 | return nil; 322 | } 323 | 324 | - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)sectionIndex 325 | { 326 | id section = [self.sectionsController sectionAtIndex:sectionIndex]; 327 | if ([section respondsToSelector:@selector(tableView:viewForFooterInSection:)]) { 328 | return [section tableView:tableView viewForFooterInSection:sectionIndex]; 329 | } 330 | return nil; 331 | } 332 | 333 | - (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath 334 | { 335 | id row = [self rowAtIndexPath:indexPath]; 336 | if ([row respondsToSelector:@selector(tableView:accessoryButtonTappedForRowWithIndexPath:)]) { 337 | [row tableView:tableView accessoryButtonTappedForRowWithIndexPath:indexPath]; 338 | } 339 | } 340 | 341 | - (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath 342 | { 343 | id row = [self rowAtIndexPath:indexPath]; 344 | if ([row respondsToSelector:@selector(tableView:shouldHighlightRowAtIndexPath:)]) { 345 | return [row tableView:tableView shouldHighlightRowAtIndexPath:indexPath]; 346 | } 347 | return YES; 348 | } 349 | 350 | - (void)tableView:(UITableView *)tableView didHighlightRowAtIndexPath:(NSIndexPath *)indexPath 351 | { 352 | id row = [self rowAtIndexPath:indexPath]; 353 | if ([row respondsToSelector:@selector(tableView:didHighlightRowAtIndexPath:)]) { 354 | [row tableView:tableView didHighlightRowAtIndexPath:indexPath]; 355 | } 356 | } 357 | 358 | - (void)tableView:(UITableView *)tableView didUnhighlightRowAtIndexPath:(NSIndexPath *)indexPath 359 | { 360 | id row = [self rowAtIndexPath:indexPath]; 361 | if ([row respondsToSelector:@selector(tableView:didUnhighlightRowAtIndexPath:)]) { 362 | [row tableView:tableView didUnhighlightRowAtIndexPath:indexPath]; 363 | } 364 | } 365 | 366 | - (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath 367 | { 368 | id row = [self rowAtIndexPath:indexPath]; 369 | if ([row respondsToSelector:@selector(tableView:willSelectRowAtIndexPath:)]) { 370 | return [row tableView:tableView willSelectRowAtIndexPath:indexPath]; 371 | } 372 | return indexPath; 373 | } 374 | 375 | - (NSIndexPath *)tableView:(UITableView *)tableView willDeselectRowAtIndexPath:(NSIndexPath *)indexPath 376 | { 377 | id row = [self rowAtIndexPath:indexPath]; 378 | if ([row respondsToSelector:@selector(tableView:willDeselectRowAtIndexPath:)]) { 379 | return [row tableView:tableView willDeselectRowAtIndexPath:indexPath]; 380 | } 381 | return indexPath; 382 | } 383 | 384 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 385 | { 386 | id row = [self rowAtIndexPath:indexPath]; 387 | if ([row respondsToSelector:@selector(tableView:didSelectRowAtIndexPath:)]) { 388 | [row tableView:tableView didSelectRowAtIndexPath:indexPath]; 389 | } 390 | } 391 | 392 | - (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath 393 | { 394 | id row = [self rowAtIndexPath:indexPath]; 395 | if ([row respondsToSelector:@selector(tableView:didDeselectRowAtIndexPath:)]) { 396 | [row tableView:tableView didDeselectRowAtIndexPath:indexPath]; 397 | } 398 | } 399 | 400 | - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath 401 | { 402 | id row = [self rowAtIndexPath:indexPath]; 403 | if ([row respondsToSelector:@selector(tableView:editingStyleForRowAtIndexPath:)]) { 404 | return [row tableView:tableView editingStyleForRowAtIndexPath:indexPath]; 405 | } 406 | return UITableViewCellEditingStyleDelete; 407 | } 408 | 409 | - (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath 410 | { 411 | id row = [self rowAtIndexPath:indexPath]; 412 | if ([row respondsToSelector:@selector(tableView:titleForDeleteConfirmationButtonForRowAtIndexPath:)]) { 413 | return [row tableView:tableView titleForDeleteConfirmationButtonForRowAtIndexPath:indexPath]; 414 | } 415 | return nil; 416 | } 417 | 418 | - (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath 419 | { 420 | id row = [self rowAtIndexPath:indexPath]; 421 | if ([row respondsToSelector:@selector(tableView:editActionsForRowAtIndexPath:)]) { 422 | return [row tableView:tableView editActionsForRowAtIndexPath:indexPath]; 423 | } 424 | return nil; 425 | } 426 | 427 | - (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath 428 | { 429 | id row = [self rowAtIndexPath:indexPath]; 430 | if ([row respondsToSelector:@selector(tableView:shouldIndentWhileEditingRowAtIndexPath:)]) { 431 | return [row tableView:tableView shouldIndentWhileEditingRowAtIndexPath:indexPath]; 432 | } 433 | return NO; 434 | } 435 | 436 | - (void)tableView:(UITableView *)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath 437 | { 438 | id row = [self rowAtIndexPath:indexPath]; 439 | if ([row respondsToSelector:@selector(tableView:willBeginEditingRowAtIndexPath:)]) { 440 | [row tableView:tableView willBeginEditingRowAtIndexPath:indexPath]; 441 | } 442 | } 443 | 444 | - (void)tableView:(UITableView *)tableView didEndEditingRowAtIndexPath:(NSIndexPath *)indexPath 445 | { 446 | id row = [self rowAtIndexPath:indexPath]; 447 | if ([row respondsToSelector:@selector(tableView:didEndEditingRowAtIndexPath:)]) { 448 | [row tableView:tableView didEndEditingRowAtIndexPath:indexPath]; 449 | } 450 | } 451 | 452 | - (NSIndexPath *)tableView:(UITableView *)tableView targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath toProposedIndexPath:(NSIndexPath *)proposedDestinationIndexPath 453 | { 454 | id row = [self rowAtIndexPath:sourceIndexPath]; 455 | if ([row respondsToSelector:@selector(tableView:targetIndexPathForMoveFromRowAtIndexPath:toProposedIndexPath:)]) { 456 | return [row tableView:tableView targetIndexPathForMoveFromRowAtIndexPath:sourceIndexPath toProposedIndexPath:proposedDestinationIndexPath]; 457 | } 458 | return nil; 459 | } 460 | 461 | - (NSInteger)tableView:(UITableView *)tableView indentationLevelForRowAtIndexPath:(NSIndexPath *)indexPath 462 | { 463 | id row = [self rowAtIndexPath:indexPath]; 464 | if ([row respondsToSelector:@selector(tableView:indentationLevelForRowAtIndexPath:)]) { 465 | return [row tableView:tableView indentationLevelForRowAtIndexPath:indexPath]; 466 | } 467 | return 0; 468 | } 469 | 470 | - (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath 471 | { 472 | id row = [self rowAtIndexPath:indexPath]; 473 | if ([row respondsToSelector:@selector(tableView:shouldShowMenuForRowAtIndexPath:)]) { 474 | return [row tableView:tableView shouldShowMenuForRowAtIndexPath:indexPath]; 475 | } 476 | return NO; 477 | } 478 | 479 | - (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender 480 | { 481 | id row = [self rowAtIndexPath:indexPath]; 482 | if ([row respondsToSelector:@selector(tableView:canPerformAction:forRowAtIndexPath:withSender:)]) { 483 | return [row tableView:tableView canPerformAction:action forRowAtIndexPath:indexPath withSender:sender]; 484 | } 485 | return NO; 486 | } 487 | 488 | - (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender 489 | { 490 | id row = [self rowAtIndexPath:indexPath]; 491 | if ([row respondsToSelector:@selector(tableView:performAction:forRowAtIndexPath:withSender:)]) { 492 | [row tableView:tableView performAction:action forRowAtIndexPath:indexPath withSender:sender]; 493 | } 494 | } 495 | 496 | #pragma mark - UIScrollViewDelegate 497 | 498 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView 499 | { 500 | if ([self.scrollViewDelegate respondsToSelector:@selector(scrollViewDidScroll:)]) { 501 | [self.scrollViewDelegate scrollViewDidScroll:scrollView]; 502 | } 503 | } 504 | 505 | - (void)scrollViewDidZoom:(UIScrollView *)scrollView 506 | { 507 | if ([self.scrollViewDelegate respondsToSelector:@selector(scrollViewDidZoom:)]) { 508 | [self.scrollViewDelegate scrollViewDidZoom:scrollView]; 509 | } 510 | } 511 | 512 | - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView 513 | { 514 | if ([self.scrollViewDelegate respondsToSelector:@selector(scrollViewWillBeginDragging:)]) { 515 | [self.scrollViewDelegate scrollViewWillBeginDragging:scrollView]; 516 | } 517 | } 518 | 519 | - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset 520 | { 521 | if ([self.scrollViewDelegate respondsToSelector:@selector(scrollViewWillEndDragging:withVelocity:targetContentOffset:)]) { 522 | [self.scrollViewDelegate scrollViewWillEndDragging:scrollView withVelocity:velocity targetContentOffset:targetContentOffset]; 523 | } 524 | } 525 | 526 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate 527 | { 528 | if ([self.scrollViewDelegate respondsToSelector:@selector(scrollViewDidEndDragging:willDecelerate:)]) { 529 | [self.scrollViewDelegate scrollViewDidEndDragging:scrollView willDecelerate:decelerate]; 530 | } 531 | } 532 | 533 | - (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView 534 | { 535 | if ([self.scrollViewDelegate respondsToSelector:@selector(scrollViewWillBeginDecelerating:)]) { 536 | [self.scrollViewDelegate scrollViewWillBeginDecelerating:scrollView]; 537 | } 538 | } 539 | 540 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView 541 | { 542 | if ([self.scrollViewDelegate respondsToSelector:@selector(scrollViewDidEndDecelerating:)]) { 543 | [self.scrollViewDelegate scrollViewDidEndDecelerating:scrollView]; 544 | } 545 | } 546 | 547 | - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView 548 | { 549 | if ([self.scrollViewDelegate respondsToSelector:@selector(scrollViewDidEndScrollingAnimation:)]) { 550 | [self.scrollViewDelegate scrollViewDidEndScrollingAnimation:scrollView]; 551 | } 552 | } 553 | 554 | - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView 555 | { 556 | if ([self.scrollViewDelegate respondsToSelector:@selector(viewForZoomingInScrollView:)]) { 557 | return [self.scrollViewDelegate viewForZoomingInScrollView:scrollView]; 558 | } 559 | return nil; 560 | } 561 | 562 | - (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(UIView *)view 563 | { 564 | if ([self.scrollViewDelegate respondsToSelector:@selector(scrollViewWillBeginZooming:withView:)]) { 565 | [self.scrollViewDelegate scrollViewWillBeginZooming:scrollView withView:view]; 566 | } 567 | } 568 | 569 | - (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale 570 | { 571 | if ([self.scrollViewDelegate respondsToSelector:@selector(scrollViewDidEndZooming:withView:atScale:)]) { 572 | [self.scrollViewDelegate scrollViewDidEndZooming:scrollView withView:view atScale:scale]; 573 | } 574 | } 575 | 576 | - (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView 577 | { 578 | if ([self.scrollViewDelegate respondsToSelector:@selector(scrollViewShouldScrollToTop:)]) { 579 | return [self.scrollViewDelegate scrollViewShouldScrollToTop:scrollView]; 580 | } 581 | return YES; 582 | } 583 | 584 | - (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView 585 | { 586 | if ([self.scrollViewDelegate respondsToSelector:@selector(scrollViewDidScrollToTop:)]) { 587 | [self.scrollViewDelegate scrollViewDidScrollToTop:scrollView]; 588 | } 589 | } 590 | 591 | @end 592 | -------------------------------------------------------------------------------- /DRTableViewManagerExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3182D6581AA4B766007F2C51 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 3182D6571AA4B766007F2C51 /* main.m */; }; 11 | 3182D65B1AA4B766007F2C51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3182D65A1AA4B766007F2C51 /* AppDelegate.m */; }; 12 | 3182D65E1AA4B766007F2C51 /* Example1ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3182D65D1AA4B766007F2C51 /* Example1ViewController.m */; }; 13 | 3182D6611AA4B766007F2C51 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3182D65F1AA4B766007F2C51 /* Main.storyboard */; }; 14 | 3182D6631AA4B766007F2C51 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3182D6621AA4B766007F2C51 /* Images.xcassets */; }; 15 | 3182D6661AA4B766007F2C51 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3182D6641AA4B766007F2C51 /* LaunchScreen.xib */; }; 16 | 3182D6721AA4B766007F2C51 /* DRTableViewManagerExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3182D6711AA4B766007F2C51 /* DRTableViewManagerExampleTests.m */; }; 17 | 3182D6811AA4BA39007F2C51 /* DRTableViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3182D6801AA4BA39007F2C51 /* DRTableViewManager.m */; }; 18 | 3182D68D1AA4DA6F007F2C51 /* DRTableViewGenericRow.m in Sources */ = {isa = PBXBuildFile; fileRef = 3182D68C1AA4DA6F007F2C51 /* DRTableViewGenericRow.m */; }; 19 | 3182D6901AA4EAD0007F2C51 /* DRTableViewGenericSection.m in Sources */ = {isa = PBXBuildFile; fileRef = 3182D68F1AA4EAD0007F2C51 /* DRTableViewGenericSection.m */; }; 20 | 3182D6931AA4F603007F2C51 /* DRTableViewGenericSectionsController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3182D6921AA4F603007F2C51 /* DRTableViewGenericSectionsController.m */; }; 21 | 31CFDE961AAA83FD00D94CBE /* Example2Label.m in Sources */ = {isa = PBXBuildFile; fileRef = 31CFDE951AAA83FD00D94CBE /* Example2Label.m */; }; 22 | 31EF33441AAA4F1F007E95BC /* Example2ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 31EF33431AAA4F1F007E95BC /* Example2ViewController.m */; }; 23 | 31EF33491AAA5110007E95BC /* Example2TableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 31EF33481AAA5110007E95BC /* Example2TableViewCell.m */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXContainerItemProxy section */ 27 | 3182D66C1AA4B766007F2C51 /* PBXContainerItemProxy */ = { 28 | isa = PBXContainerItemProxy; 29 | containerPortal = 3182D64A1AA4B766007F2C51 /* Project object */; 30 | proxyType = 1; 31 | remoteGlobalIDString = 3182D6511AA4B766007F2C51; 32 | remoteInfo = DRTableViewManagerExample; 33 | }; 34 | /* End PBXContainerItemProxy section */ 35 | 36 | /* Begin PBXFileReference section */ 37 | 3182D6521AA4B766007F2C51 /* DRTableViewManagerExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DRTableViewManagerExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | 3182D6561AA4B766007F2C51 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 39 | 3182D6571AA4B766007F2C51 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 40 | 3182D6591AA4B766007F2C51 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 41 | 3182D65A1AA4B766007F2C51 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 42 | 3182D65C1AA4B766007F2C51 /* Example1ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Example1ViewController.h; sourceTree = ""; }; 43 | 3182D65D1AA4B766007F2C51 /* Example1ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Example1ViewController.m; sourceTree = ""; }; 44 | 3182D6601AA4B766007F2C51 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 45 | 3182D6621AA4B766007F2C51 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 46 | 3182D6651AA4B766007F2C51 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 47 | 3182D66B1AA4B766007F2C51 /* DRTableViewManagerExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DRTableViewManagerExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | 3182D6701AA4B766007F2C51 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | 3182D6711AA4B766007F2C51 /* DRTableViewManagerExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DRTableViewManagerExampleTests.m; sourceTree = ""; }; 50 | 3182D67F1AA4BA39007F2C51 /* DRTableViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DRTableViewManager.h; sourceTree = ""; }; 51 | 3182D6801AA4BA39007F2C51 /* DRTableViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DRTableViewManager.m; sourceTree = ""; }; 52 | 3182D6821AA4BC6B007F2C51 /* DRTableViewSectionsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DRTableViewSectionsController.h; sourceTree = ""; }; 53 | 3182D6831AA4BC85007F2C51 /* DRTableViewSection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DRTableViewSection.h; sourceTree = ""; }; 54 | 3182D6841AA4BC91007F2C51 /* DRTableViewRow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DRTableViewRow.h; sourceTree = ""; }; 55 | 3182D68B1AA4DA6F007F2C51 /* DRTableViewGenericRow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DRTableViewGenericRow.h; sourceTree = ""; }; 56 | 3182D68C1AA4DA6F007F2C51 /* DRTableViewGenericRow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DRTableViewGenericRow.m; sourceTree = ""; }; 57 | 3182D68E1AA4EAD0007F2C51 /* DRTableViewGenericSection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DRTableViewGenericSection.h; sourceTree = ""; }; 58 | 3182D68F1AA4EAD0007F2C51 /* DRTableViewGenericSection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DRTableViewGenericSection.m; sourceTree = ""; }; 59 | 3182D6911AA4F603007F2C51 /* DRTableViewGenericSectionsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DRTableViewGenericSectionsController.h; sourceTree = ""; }; 60 | 3182D6921AA4F603007F2C51 /* DRTableViewGenericSectionsController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DRTableViewGenericSectionsController.m; sourceTree = ""; }; 61 | 31CFDE941AAA83FD00D94CBE /* Example2Label.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Example2Label.h; sourceTree = ""; }; 62 | 31CFDE951AAA83FD00D94CBE /* Example2Label.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Example2Label.m; sourceTree = ""; }; 63 | 31EF33421AAA4F1F007E95BC /* Example2ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Example2ViewController.h; sourceTree = ""; }; 64 | 31EF33431AAA4F1F007E95BC /* Example2ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Example2ViewController.m; sourceTree = ""; }; 65 | 31EF33471AAA5110007E95BC /* Example2TableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Example2TableViewCell.h; sourceTree = ""; }; 66 | 31EF33481AAA5110007E95BC /* Example2TableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Example2TableViewCell.m; sourceTree = ""; }; 67 | /* End PBXFileReference section */ 68 | 69 | /* Begin PBXFrameworksBuildPhase section */ 70 | 3182D64F1AA4B766007F2C51 /* Frameworks */ = { 71 | isa = PBXFrameworksBuildPhase; 72 | buildActionMask = 2147483647; 73 | files = ( 74 | ); 75 | runOnlyForDeploymentPostprocessing = 0; 76 | }; 77 | 3182D6681AA4B766007F2C51 /* Frameworks */ = { 78 | isa = PBXFrameworksBuildPhase; 79 | buildActionMask = 2147483647; 80 | files = ( 81 | ); 82 | runOnlyForDeploymentPostprocessing = 0; 83 | }; 84 | /* End PBXFrameworksBuildPhase section */ 85 | 86 | /* Begin PBXGroup section */ 87 | 3182D6491AA4B766007F2C51 = { 88 | isa = PBXGroup; 89 | children = ( 90 | 3182D67E1AA4B8C7007F2C51 /* DRTableViewManager */, 91 | 3182D6541AA4B766007F2C51 /* DRTableViewManagerExample */, 92 | 3182D66E1AA4B766007F2C51 /* DRTableViewManagerExampleTests */, 93 | 3182D6531AA4B766007F2C51 /* Products */, 94 | ); 95 | sourceTree = ""; 96 | }; 97 | 3182D6531AA4B766007F2C51 /* Products */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 3182D6521AA4B766007F2C51 /* DRTableViewManagerExample.app */, 101 | 3182D66B1AA4B766007F2C51 /* DRTableViewManagerExampleTests.xctest */, 102 | ); 103 | name = Products; 104 | sourceTree = ""; 105 | }; 106 | 3182D6541AA4B766007F2C51 /* DRTableViewManagerExample */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | 3182D67B1AA4B80B007F2C51 /* Application */, 110 | 3182D67D1AA4B82C007F2C51 /* Resources */, 111 | 3182D6551AA4B766007F2C51 /* Supporting Files */, 112 | 3182D67C1AA4B817007F2C51 /* UI */, 113 | ); 114 | path = DRTableViewManagerExample; 115 | sourceTree = ""; 116 | }; 117 | 3182D6551AA4B766007F2C51 /* Supporting Files */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 3182D6561AA4B766007F2C51 /* Info.plist */, 121 | 3182D6571AA4B766007F2C51 /* main.m */, 122 | ); 123 | path = "Supporting Files"; 124 | sourceTree = ""; 125 | }; 126 | 3182D66E1AA4B766007F2C51 /* DRTableViewManagerExampleTests */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 3182D6711AA4B766007F2C51 /* DRTableViewManagerExampleTests.m */, 130 | 3182D66F1AA4B766007F2C51 /* Supporting Files */, 131 | ); 132 | path = DRTableViewManagerExampleTests; 133 | sourceTree = ""; 134 | }; 135 | 3182D66F1AA4B766007F2C51 /* Supporting Files */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 3182D6701AA4B766007F2C51 /* Info.plist */, 139 | ); 140 | path = "Supporting Files"; 141 | sourceTree = ""; 142 | }; 143 | 3182D67B1AA4B80B007F2C51 /* Application */ = { 144 | isa = PBXGroup; 145 | children = ( 146 | 3182D6591AA4B766007F2C51 /* AppDelegate.h */, 147 | 3182D65A1AA4B766007F2C51 /* AppDelegate.m */, 148 | ); 149 | path = Application; 150 | sourceTree = ""; 151 | }; 152 | 3182D67C1AA4B817007F2C51 /* UI */ = { 153 | isa = PBXGroup; 154 | children = ( 155 | 31EF33461AAA50CF007E95BC /* Example 1 */, 156 | 31EF33451AAA50A3007E95BC /* Example 2 */, 157 | 3182D6641AA4B766007F2C51 /* LaunchScreen.xib */, 158 | 3182D65F1AA4B766007F2C51 /* Main.storyboard */, 159 | ); 160 | path = UI; 161 | sourceTree = ""; 162 | }; 163 | 3182D67D1AA4B82C007F2C51 /* Resources */ = { 164 | isa = PBXGroup; 165 | children = ( 166 | 3182D6621AA4B766007F2C51 /* Images.xcassets */, 167 | ); 168 | path = Resources; 169 | sourceTree = ""; 170 | }; 171 | 3182D67E1AA4B8C7007F2C51 /* DRTableViewManager */ = { 172 | isa = PBXGroup; 173 | children = ( 174 | 3182D68B1AA4DA6F007F2C51 /* DRTableViewGenericRow.h */, 175 | 3182D68C1AA4DA6F007F2C51 /* DRTableViewGenericRow.m */, 176 | 3182D68E1AA4EAD0007F2C51 /* DRTableViewGenericSection.h */, 177 | 3182D68F1AA4EAD0007F2C51 /* DRTableViewGenericSection.m */, 178 | 3182D6911AA4F603007F2C51 /* DRTableViewGenericSectionsController.h */, 179 | 3182D6921AA4F603007F2C51 /* DRTableViewGenericSectionsController.m */, 180 | 3182D67F1AA4BA39007F2C51 /* DRTableViewManager.h */, 181 | 3182D6801AA4BA39007F2C51 /* DRTableViewManager.m */, 182 | 3182D6841AA4BC91007F2C51 /* DRTableViewRow.h */, 183 | 3182D6831AA4BC85007F2C51 /* DRTableViewSection.h */, 184 | 3182D6821AA4BC6B007F2C51 /* DRTableViewSectionsController.h */, 185 | ); 186 | path = DRTableViewManager; 187 | sourceTree = ""; 188 | }; 189 | 31EF33451AAA50A3007E95BC /* Example 2 */ = { 190 | isa = PBXGroup; 191 | children = ( 192 | 31CFDE941AAA83FD00D94CBE /* Example2Label.h */, 193 | 31CFDE951AAA83FD00D94CBE /* Example2Label.m */, 194 | 31EF33471AAA5110007E95BC /* Example2TableViewCell.h */, 195 | 31EF33481AAA5110007E95BC /* Example2TableViewCell.m */, 196 | 31EF33421AAA4F1F007E95BC /* Example2ViewController.h */, 197 | 31EF33431AAA4F1F007E95BC /* Example2ViewController.m */, 198 | ); 199 | path = "Example 2"; 200 | sourceTree = ""; 201 | }; 202 | 31EF33461AAA50CF007E95BC /* Example 1 */ = { 203 | isa = PBXGroup; 204 | children = ( 205 | 3182D65C1AA4B766007F2C51 /* Example1ViewController.h */, 206 | 3182D65D1AA4B766007F2C51 /* Example1ViewController.m */, 207 | ); 208 | path = "Example 1"; 209 | sourceTree = ""; 210 | }; 211 | /* End PBXGroup section */ 212 | 213 | /* Begin PBXNativeTarget section */ 214 | 3182D6511AA4B766007F2C51 /* DRTableViewManagerExample */ = { 215 | isa = PBXNativeTarget; 216 | buildConfigurationList = 3182D6751AA4B766007F2C51 /* Build configuration list for PBXNativeTarget "DRTableViewManagerExample" */; 217 | buildPhases = ( 218 | 3182D64E1AA4B766007F2C51 /* Sources */, 219 | 3182D64F1AA4B766007F2C51 /* Frameworks */, 220 | 3182D6501AA4B766007F2C51 /* Resources */, 221 | ); 222 | buildRules = ( 223 | ); 224 | dependencies = ( 225 | ); 226 | name = DRTableViewManagerExample; 227 | productName = DRTableViewManagerExample; 228 | productReference = 3182D6521AA4B766007F2C51 /* DRTableViewManagerExample.app */; 229 | productType = "com.apple.product-type.application"; 230 | }; 231 | 3182D66A1AA4B766007F2C51 /* DRTableViewManagerExampleTests */ = { 232 | isa = PBXNativeTarget; 233 | buildConfigurationList = 3182D6781AA4B766007F2C51 /* Build configuration list for PBXNativeTarget "DRTableViewManagerExampleTests" */; 234 | buildPhases = ( 235 | 3182D6671AA4B766007F2C51 /* Sources */, 236 | 3182D6681AA4B766007F2C51 /* Frameworks */, 237 | 3182D6691AA4B766007F2C51 /* Resources */, 238 | ); 239 | buildRules = ( 240 | ); 241 | dependencies = ( 242 | 3182D66D1AA4B766007F2C51 /* PBXTargetDependency */, 243 | ); 244 | name = DRTableViewManagerExampleTests; 245 | productName = DRTableViewManagerExampleTests; 246 | productReference = 3182D66B1AA4B766007F2C51 /* DRTableViewManagerExampleTests.xctest */; 247 | productType = "com.apple.product-type.bundle.unit-test"; 248 | }; 249 | /* End PBXNativeTarget section */ 250 | 251 | /* Begin PBXProject section */ 252 | 3182D64A1AA4B766007F2C51 /* Project object */ = { 253 | isa = PBXProject; 254 | attributes = { 255 | LastUpgradeCheck = 0610; 256 | ORGANIZATIONNAME = Darrarski; 257 | TargetAttributes = { 258 | 3182D6511AA4B766007F2C51 = { 259 | CreatedOnToolsVersion = 6.1.1; 260 | }; 261 | 3182D66A1AA4B766007F2C51 = { 262 | CreatedOnToolsVersion = 6.1.1; 263 | TestTargetID = 3182D6511AA4B766007F2C51; 264 | }; 265 | }; 266 | }; 267 | buildConfigurationList = 3182D64D1AA4B766007F2C51 /* Build configuration list for PBXProject "DRTableViewManagerExample" */; 268 | compatibilityVersion = "Xcode 3.2"; 269 | developmentRegion = English; 270 | hasScannedForEncodings = 0; 271 | knownRegions = ( 272 | en, 273 | Base, 274 | ); 275 | mainGroup = 3182D6491AA4B766007F2C51; 276 | productRefGroup = 3182D6531AA4B766007F2C51 /* Products */; 277 | projectDirPath = ""; 278 | projectRoot = ""; 279 | targets = ( 280 | 3182D6511AA4B766007F2C51 /* DRTableViewManagerExample */, 281 | 3182D66A1AA4B766007F2C51 /* DRTableViewManagerExampleTests */, 282 | ); 283 | }; 284 | /* End PBXProject section */ 285 | 286 | /* Begin PBXResourcesBuildPhase section */ 287 | 3182D6501AA4B766007F2C51 /* Resources */ = { 288 | isa = PBXResourcesBuildPhase; 289 | buildActionMask = 2147483647; 290 | files = ( 291 | 3182D6611AA4B766007F2C51 /* Main.storyboard in Resources */, 292 | 3182D6661AA4B766007F2C51 /* LaunchScreen.xib in Resources */, 293 | 3182D6631AA4B766007F2C51 /* Images.xcassets in Resources */, 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | }; 297 | 3182D6691AA4B766007F2C51 /* Resources */ = { 298 | isa = PBXResourcesBuildPhase; 299 | buildActionMask = 2147483647; 300 | files = ( 301 | ); 302 | runOnlyForDeploymentPostprocessing = 0; 303 | }; 304 | /* End PBXResourcesBuildPhase section */ 305 | 306 | /* Begin PBXSourcesBuildPhase section */ 307 | 3182D64E1AA4B766007F2C51 /* Sources */ = { 308 | isa = PBXSourcesBuildPhase; 309 | buildActionMask = 2147483647; 310 | files = ( 311 | 31EF33441AAA4F1F007E95BC /* Example2ViewController.m in Sources */, 312 | 31EF33491AAA5110007E95BC /* Example2TableViewCell.m in Sources */, 313 | 31CFDE961AAA83FD00D94CBE /* Example2Label.m in Sources */, 314 | 3182D65E1AA4B766007F2C51 /* Example1ViewController.m in Sources */, 315 | 3182D6901AA4EAD0007F2C51 /* DRTableViewGenericSection.m in Sources */, 316 | 3182D65B1AA4B766007F2C51 /* AppDelegate.m in Sources */, 317 | 3182D6931AA4F603007F2C51 /* DRTableViewGenericSectionsController.m in Sources */, 318 | 3182D6581AA4B766007F2C51 /* main.m in Sources */, 319 | 3182D6811AA4BA39007F2C51 /* DRTableViewManager.m in Sources */, 320 | 3182D68D1AA4DA6F007F2C51 /* DRTableViewGenericRow.m in Sources */, 321 | ); 322 | runOnlyForDeploymentPostprocessing = 0; 323 | }; 324 | 3182D6671AA4B766007F2C51 /* Sources */ = { 325 | isa = PBXSourcesBuildPhase; 326 | buildActionMask = 2147483647; 327 | files = ( 328 | 3182D6721AA4B766007F2C51 /* DRTableViewManagerExampleTests.m in Sources */, 329 | ); 330 | runOnlyForDeploymentPostprocessing = 0; 331 | }; 332 | /* End PBXSourcesBuildPhase section */ 333 | 334 | /* Begin PBXTargetDependency section */ 335 | 3182D66D1AA4B766007F2C51 /* PBXTargetDependency */ = { 336 | isa = PBXTargetDependency; 337 | target = 3182D6511AA4B766007F2C51 /* DRTableViewManagerExample */; 338 | targetProxy = 3182D66C1AA4B766007F2C51 /* PBXContainerItemProxy */; 339 | }; 340 | /* End PBXTargetDependency section */ 341 | 342 | /* Begin PBXVariantGroup section */ 343 | 3182D65F1AA4B766007F2C51 /* Main.storyboard */ = { 344 | isa = PBXVariantGroup; 345 | children = ( 346 | 3182D6601AA4B766007F2C51 /* Base */, 347 | ); 348 | name = Main.storyboard; 349 | sourceTree = ""; 350 | }; 351 | 3182D6641AA4B766007F2C51 /* LaunchScreen.xib */ = { 352 | isa = PBXVariantGroup; 353 | children = ( 354 | 3182D6651AA4B766007F2C51 /* Base */, 355 | ); 356 | name = LaunchScreen.xib; 357 | sourceTree = ""; 358 | }; 359 | /* End PBXVariantGroup section */ 360 | 361 | /* Begin XCBuildConfiguration section */ 362 | 3182D6731AA4B766007F2C51 /* Debug */ = { 363 | isa = XCBuildConfiguration; 364 | buildSettings = { 365 | ALWAYS_SEARCH_USER_PATHS = NO; 366 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 367 | CLANG_CXX_LIBRARY = "libc++"; 368 | CLANG_ENABLE_MODULES = YES; 369 | CLANG_ENABLE_OBJC_ARC = YES; 370 | CLANG_WARN_BOOL_CONVERSION = YES; 371 | CLANG_WARN_CONSTANT_CONVERSION = YES; 372 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 373 | CLANG_WARN_EMPTY_BODY = YES; 374 | CLANG_WARN_ENUM_CONVERSION = YES; 375 | CLANG_WARN_INT_CONVERSION = YES; 376 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 377 | CLANG_WARN_UNREACHABLE_CODE = YES; 378 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 379 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 380 | COPY_PHASE_STRIP = NO; 381 | ENABLE_STRICT_OBJC_MSGSEND = YES; 382 | GCC_C_LANGUAGE_STANDARD = gnu99; 383 | GCC_DYNAMIC_NO_PIC = NO; 384 | GCC_OPTIMIZATION_LEVEL = 0; 385 | GCC_PREPROCESSOR_DEFINITIONS = ( 386 | "DEBUG=1", 387 | "$(inherited)", 388 | ); 389 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 390 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 391 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 392 | GCC_WARN_UNDECLARED_SELECTOR = YES; 393 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 394 | GCC_WARN_UNUSED_FUNCTION = YES; 395 | GCC_WARN_UNUSED_VARIABLE = YES; 396 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 397 | MTL_ENABLE_DEBUG_INFO = YES; 398 | ONLY_ACTIVE_ARCH = YES; 399 | SDKROOT = iphoneos; 400 | }; 401 | name = Debug; 402 | }; 403 | 3182D6741AA4B766007F2C51 /* Release */ = { 404 | isa = XCBuildConfiguration; 405 | buildSettings = { 406 | ALWAYS_SEARCH_USER_PATHS = NO; 407 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 408 | CLANG_CXX_LIBRARY = "libc++"; 409 | CLANG_ENABLE_MODULES = YES; 410 | CLANG_ENABLE_OBJC_ARC = YES; 411 | CLANG_WARN_BOOL_CONVERSION = YES; 412 | CLANG_WARN_CONSTANT_CONVERSION = YES; 413 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 414 | CLANG_WARN_EMPTY_BODY = YES; 415 | CLANG_WARN_ENUM_CONVERSION = YES; 416 | CLANG_WARN_INT_CONVERSION = YES; 417 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 418 | CLANG_WARN_UNREACHABLE_CODE = YES; 419 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 420 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 421 | COPY_PHASE_STRIP = YES; 422 | ENABLE_NS_ASSERTIONS = NO; 423 | ENABLE_STRICT_OBJC_MSGSEND = YES; 424 | GCC_C_LANGUAGE_STANDARD = gnu99; 425 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 426 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 427 | GCC_WARN_UNDECLARED_SELECTOR = YES; 428 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 429 | GCC_WARN_UNUSED_FUNCTION = YES; 430 | GCC_WARN_UNUSED_VARIABLE = YES; 431 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 432 | MTL_ENABLE_DEBUG_INFO = NO; 433 | SDKROOT = iphoneos; 434 | VALIDATE_PRODUCT = YES; 435 | }; 436 | name = Release; 437 | }; 438 | 3182D6761AA4B766007F2C51 /* Debug */ = { 439 | isa = XCBuildConfiguration; 440 | buildSettings = { 441 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 442 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 443 | INFOPLIST_FILE = "DRTableViewManagerExample/Supporting Files/Info.plist"; 444 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 445 | PRODUCT_NAME = "$(TARGET_NAME)"; 446 | }; 447 | name = Debug; 448 | }; 449 | 3182D6771AA4B766007F2C51 /* Release */ = { 450 | isa = XCBuildConfiguration; 451 | buildSettings = { 452 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 453 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 454 | INFOPLIST_FILE = "DRTableViewManagerExample/Supporting Files/Info.plist"; 455 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 456 | PRODUCT_NAME = "$(TARGET_NAME)"; 457 | }; 458 | name = Release; 459 | }; 460 | 3182D6791AA4B766007F2C51 /* Debug */ = { 461 | isa = XCBuildConfiguration; 462 | buildSettings = { 463 | BUNDLE_LOADER = "$(TEST_HOST)"; 464 | FRAMEWORK_SEARCH_PATHS = ( 465 | "$(SDKROOT)/Developer/Library/Frameworks", 466 | "$(inherited)", 467 | ); 468 | GCC_PREPROCESSOR_DEFINITIONS = ( 469 | "DEBUG=1", 470 | "$(inherited)", 471 | ); 472 | INFOPLIST_FILE = "DRTableViewManagerExampleTests/Supporting Files/Info.plist"; 473 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 474 | PRODUCT_NAME = "$(TARGET_NAME)"; 475 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DRTableViewManagerExample.app/DRTableViewManagerExample"; 476 | }; 477 | name = Debug; 478 | }; 479 | 3182D67A1AA4B766007F2C51 /* Release */ = { 480 | isa = XCBuildConfiguration; 481 | buildSettings = { 482 | BUNDLE_LOADER = "$(TEST_HOST)"; 483 | FRAMEWORK_SEARCH_PATHS = ( 484 | "$(SDKROOT)/Developer/Library/Frameworks", 485 | "$(inherited)", 486 | ); 487 | INFOPLIST_FILE = "DRTableViewManagerExampleTests/Supporting Files/Info.plist"; 488 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 489 | PRODUCT_NAME = "$(TARGET_NAME)"; 490 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DRTableViewManagerExample.app/DRTableViewManagerExample"; 491 | }; 492 | name = Release; 493 | }; 494 | /* End XCBuildConfiguration section */ 495 | 496 | /* Begin XCConfigurationList section */ 497 | 3182D64D1AA4B766007F2C51 /* Build configuration list for PBXProject "DRTableViewManagerExample" */ = { 498 | isa = XCConfigurationList; 499 | buildConfigurations = ( 500 | 3182D6731AA4B766007F2C51 /* Debug */, 501 | 3182D6741AA4B766007F2C51 /* Release */, 502 | ); 503 | defaultConfigurationIsVisible = 0; 504 | defaultConfigurationName = Release; 505 | }; 506 | 3182D6751AA4B766007F2C51 /* Build configuration list for PBXNativeTarget "DRTableViewManagerExample" */ = { 507 | isa = XCConfigurationList; 508 | buildConfigurations = ( 509 | 3182D6761AA4B766007F2C51 /* Debug */, 510 | 3182D6771AA4B766007F2C51 /* Release */, 511 | ); 512 | defaultConfigurationIsVisible = 0; 513 | defaultConfigurationName = Release; 514 | }; 515 | 3182D6781AA4B766007F2C51 /* Build configuration list for PBXNativeTarget "DRTableViewManagerExampleTests" */ = { 516 | isa = XCConfigurationList; 517 | buildConfigurations = ( 518 | 3182D6791AA4B766007F2C51 /* Debug */, 519 | 3182D67A1AA4B766007F2C51 /* Release */, 520 | ); 521 | defaultConfigurationIsVisible = 0; 522 | defaultConfigurationName = Release; 523 | }; 524 | /* End XCConfigurationList section */ 525 | }; 526 | rootObject = 3182D64A1AA4B766007F2C51 /* Project object */; 527 | } 528 | --------------------------------------------------------------------------------