├── ExpandableTable ├── en.lproj │ └── InfoPlist.strings ├── up-arrow.png ├── down-arrow.png ├── ExpandableTableAppDelegate.h ├── ExpandableTable-Prefix.pch ├── main.m ├── ExpandableTableViewCell.h ├── ExpandableTableViewController.h ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── ExpandableTableViewCell.m ├── Base.lproj │ ├── Main_iPad.storyboard │ └── Main_iPhone.storyboard ├── ExpandableTable-Info.plist ├── data.plist ├── ExpandableTableAppDelegate.m └── ExpandableTableViewController.m ├── ExpandableTableTests ├── en.lproj │ └── InfoPlist.strings ├── ExpandableTableTests-Info.plist └── ExpandableTableTests.m ├── ExpandableTable.xcodeproj ├── xcuserdata │ └── manpreet.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── xcschememanagement.plist │ │ └── ExpandableTable.xcscheme ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcuserdata │ │ └── manpreet.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcshareddata │ │ └── ExpandableTable.xccheckout └── project.pbxproj └── README.md /ExpandableTable/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /ExpandableTableTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /ExpandableTable/up-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/singhson/Expandable-Collapsable-TableView/HEAD/ExpandableTable/up-arrow.png -------------------------------------------------------------------------------- /ExpandableTable/down-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/singhson/Expandable-Collapsable-TableView/HEAD/ExpandableTable/down-arrow.png -------------------------------------------------------------------------------- /ExpandableTable.xcodeproj/xcuserdata/manpreet.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /ExpandableTable.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ExpandableTable.xcodeproj/project.xcworkspace/xcuserdata/manpreet.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/singhson/Expandable-Collapsable-TableView/HEAD/ExpandableTable.xcodeproj/project.xcworkspace/xcuserdata/manpreet.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ExpandableTable/ExpandableTableAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // ExpandableTableAppDelegate.h 3 | // ExpandableTable 4 | // 5 | // Created by Manpreet Singh on 06/12/13. 6 | // Copyright (c) 2013 Manpreet Singh. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ExpandableTableAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ExpandableTable/ExpandableTable-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /ExpandableTable/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ExpandableTable 4 | // 5 | // Created by Manpreet Singh on 06/12/13. 6 | // Copyright (c) 2013 Manpreet Singh. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "ExpandableTableAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([ExpandableTableAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ExpandableTable/ExpandableTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // ExpandableTableViewCell.h 3 | // ExpandableTable 4 | // 5 | // Created by Manpreet Singh on 06/12/13. 6 | // Copyright (c) 2013 Manpreet Singh. All rights reserved. 7 | // 8 | 9 | #import 10 | @class ExpandableTableViewController; 11 | @interface ExpandableTableViewCell : UITableViewCell 12 | @property (strong, nonatomic) IBOutlet UILabel *lblTitle; 13 | @property (weak, nonatomic) IBOutlet UIButton *btnExpand; 14 | 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ExpandableTable/ExpandableTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ExpandableTableViewController.h 3 | // ExpandableTable 4 | // 5 | // Created by Manpreet Singh on 06/12/13. 6 | // Copyright (c) 2013 Manpreet Singh. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ExpandableTableViewController : UITableViewController 12 | 13 | @property(nonatomic,strong) NSArray *items; 14 | @property (nonatomic, retain) NSMutableArray *itemsInTable; 15 | @property (strong, nonatomic) IBOutlet UITableView *menuTableView; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /ExpandableTable.xcodeproj/xcuserdata/manpreet.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ExpandableTable.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 3FD2BBF11851E41D0006C787 16 | 17 | primary 18 | 19 | 20 | 3FD2BC151851E41D0006C787 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ExpandableTableTests/ExpandableTableTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | impressico.com.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Expandable-Collapsable-TableView 2 | ================================ 3 | 4 | This sample project shows how to implement Expandable/Collapsable TableView in iOS. This Project expands and collapses table view cells on selecting a cell or row of table or by tapping on a button on the cell in tableview. 5 | 6 | The project is implemented using Storyboards and is iOS7 compatible. 7 | 8 | The project is easily customizable. You can choose expand/collpase the tableview either by selecting a row or by tapping on the button in the row. If you want to use selection of row to expand the table then just delete the method: 9 | 10 | -(void)showSubItems : (id) sender 11 | 12 | If you want to use button to expand/collapse rows then just remove the code from didSelectRowAtIndexPath method and you can implement your own code in it. 13 | 14 | 15 | -------------------------------------------------------------------------------- /ExpandableTableTests/ExpandableTableTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ExpandableTableTests.m 3 | // ExpandableTableTests 4 | // 5 | // Created by Manpreet Singh on 06/12/13. 6 | // Copyright (c) 2013 Manpreet Singh. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ExpandableTableTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ExpandableTableTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /ExpandableTable/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "ipad", 20 | "size" : "29x29", 21 | "scale" : "1x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "29x29", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "40x40", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "40x40", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "76x76", 41 | "scale" : "1x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "76x76", 46 | "scale" : "2x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /ExpandableTable/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } -------------------------------------------------------------------------------- /ExpandableTable/ExpandableTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // ExpandableTableViewCell.m 3 | // ExpandableTable 4 | // 5 | // Created by Manpreet Singh on 06/12/13. 6 | // Copyright (c) 2013 Manpreet Singh. All rights reserved. 7 | // 8 | 9 | #import "ExpandableTableViewCell.h" 10 | #import "ExpandableTableViewController.h" 11 | 12 | 13 | @implementation ExpandableTableViewCell 14 | 15 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 16 | { 17 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 18 | if (self) { 19 | self.lblTitle = [[UILabel alloc]initWithFrame:CGRectMake(15, 10, 320, 20)]; 20 | self.lblTitle.backgroundColor = [UIColor clearColor]; 21 | [self.contentView addSubview:self.lblTitle]; 22 | // Initialization code 23 | } 24 | return self; 25 | } 26 | 27 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated 28 | { 29 | [super setSelected:selected animated:animated]; 30 | 31 | // Configure the view for the selected state 32 | } 33 | 34 | 35 | - (void)layoutSubviews{ 36 | [super layoutSubviews]; 37 | float indentPoints = self.indentationLevel * self.indentationWidth; 38 | 39 | self.contentView.frame = CGRectMake( 40 | indentPoints, 41 | self.contentView.frame.origin.y, 42 | self.contentView.frame.size.width - indentPoints, 43 | self.contentView.frame.size.height 44 | ); 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /ExpandableTable/Base.lproj/Main_iPad.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 | -------------------------------------------------------------------------------- /ExpandableTable.xcodeproj/project.xcworkspace/xcshareddata/ExpandableTable.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 067DEA43-EC5C-451E-A8F8-F32CE87C3C4F 9 | IDESourceControlProjectName 10 | ExpandableTable 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 26ACD049-2003-414F-8693-FF676DA88374 14 | https://github.com/singhson/Expandable-Collapsable-TableView.git 15 | 16 | IDESourceControlProjectPath 17 | ExpandableTable.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 26ACD049-2003-414F-8693-FF676DA88374 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/singhson/Expandable-Collapsable-TableView.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | 26ACD049-2003-414F-8693-FF676DA88374 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 26ACD049-2003-414F-8693-FF676DA88374 36 | IDESourceControlWCCName 37 | Expandable:Collapsable TableView 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /ExpandableTable/ExpandableTable-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | impressico.com.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main_iPhone 29 | UIMainStoryboardFile~ipad 30 | Main_iPad 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /ExpandableTable/data.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Items 6 | 7 | 8 | Name 9 | Item 0 10 | level 11 | 0 12 | 13 | 14 | Name 15 | Item 1 16 | level 17 | 0 18 | SubItems 19 | 20 | 21 | Name 22 | SubItem 0 23 | level 24 | 1 25 | 26 | 27 | Name 28 | SubItem 1 29 | level 30 | 1 31 | 32 | 33 | 34 | 35 | Name 36 | Item 2 37 | level 38 | 0 39 | SubItems 40 | 41 | 42 | Name 43 | SubItem 1 44 | level 45 | 1 46 | 47 | 48 | Name 49 | SubItem 2 50 | level 51 | 1 52 | 53 | 54 | 55 | 56 | Name 57 | Item 3 58 | level 59 | 0 60 | 61 | 62 | Name 63 | Item 4 64 | level 65 | 0 66 | 67 | 68 | Name 69 | Item 5 70 | level 71 | 0 72 | 73 | 74 | Name 75 | Item 6 76 | level 77 | 0 78 | 79 | 80 | Name 81 | Item 7 82 | level 83 | 0 84 | 85 | 86 | Name 87 | Item 8 88 | level 89 | 0 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /ExpandableTable/ExpandableTableAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // ExpandableTableAppDelegate.m 3 | // ExpandableTable 4 | // 5 | // Created by Manpreet Singh on 06/12/13. 6 | // Copyright (c) 2013 Manpreet Singh. All rights reserved. 7 | // 8 | 9 | #import "ExpandableTableAppDelegate.h" 10 | 11 | @implementation ExpandableTableAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /ExpandableTable.xcodeproj/xcuserdata/manpreet.xcuserdatad/xcschemes/ExpandableTable.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /ExpandableTable/Base.lproj/Main_iPhone.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 30 | 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 | -------------------------------------------------------------------------------- /ExpandableTable/ExpandableTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ExpandableTableViewController.m 3 | // ExpandableTable 4 | // 5 | // Created by Manpreet Singh on 06/12/13. 6 | // Copyright (c) 2013 Manpreet Singh. All rights reserved. 7 | // 8 | 9 | #import "ExpandableTableViewController.h" 10 | #import "ExpandableTableViewCell.h" 11 | 12 | @interface ExpandableTableViewController () 13 | @end 14 | 15 | 16 | 17 | @implementation ExpandableTableViewController 18 | 19 | - (id)initWithStyle:(UITableViewStyle)style 20 | { 21 | self = [super initWithStyle:style]; 22 | if (self) 23 | { 24 | // Custom initialization 25 | } 26 | return self; 27 | } 28 | 29 | - (void)viewDidLoad 30 | { 31 | [super viewDidLoad]; 32 | 33 | NSDictionary *dict=[[NSDictionary alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"data" ofType:@"plist"]]; 34 | self.items=[dict valueForKey:@"Items"]; 35 | self.itemsInTable=[[NSMutableArray alloc] init]; 36 | [self.itemsInTable addObjectsFromArray:self.items]; 37 | } 38 | 39 | - (void)didReceiveMemoryWarning 40 | { 41 | [super didReceiveMemoryWarning]; 42 | // Dispose of any resources that can be recreated. 43 | } 44 | 45 | #pragma mark - Table view data source 46 | 47 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 48 | { 49 | return 1; 50 | } 51 | 52 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 53 | { 54 | return [self.itemsInTable count]; 55 | } 56 | 57 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 58 | { 59 | NSString *Title= [[self.itemsInTable objectAtIndex:indexPath.row] valueForKey:@"Name"]; 60 | 61 | return [self createCellWithTitle:Title image:[[self.itemsInTable objectAtIndex:indexPath.row] valueForKey:@"Image name"] indexPath:indexPath]; 62 | } 63 | 64 | -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 65 | { 66 | NSDictionary *dic=[self.itemsInTable objectAtIndex:indexPath.row]; 67 | if([dic valueForKey:@"SubItems"]) 68 | { 69 | NSArray *arr=[dic valueForKey:@"SubItems"]; 70 | BOOL isTableExpanded=NO; 71 | 72 | for(NSDictionary *subitems in arr ) 73 | { 74 | NSInteger index=[self.itemsInTable indexOfObjectIdenticalTo:subitems]; 75 | isTableExpanded=(index>0 && index!=NSIntegerMax); 76 | if(isTableExpanded) break; 77 | } 78 | 79 | if(isTableExpanded) 80 | { 81 | [self CollapseRows:arr]; 82 | } 83 | else 84 | { 85 | NSUInteger count=indexPath.row+1; 86 | NSMutableArray *arrCells=[NSMutableArray array]; 87 | for(NSDictionary *dInner in arr ) 88 | { 89 | [arrCells addObject:[NSIndexPath indexPathForRow:count inSection:0]]; 90 | [self.itemsInTable insertObject:dInner atIndex:count++]; 91 | } 92 | [self.menuTableView insertRowsAtIndexPaths:arrCells withRowAnimation:UITableViewRowAnimationLeft]; 93 | } 94 | } 95 | } 96 | 97 | -(void)CollapseRows:(NSArray*)ar 98 | { 99 | for(NSDictionary *dInner in ar ) 100 | { 101 | NSUInteger indexToRemove=[self.itemsInTable indexOfObjectIdenticalTo:dInner]; 102 | NSArray *arInner=[dInner valueForKey:@"SubItems"]; 103 | if(arInner && [arInner count]>0) 104 | { 105 | [self CollapseRows:arInner]; 106 | } 107 | 108 | if([self.itemsInTable indexOfObjectIdenticalTo:dInner]!=NSNotFound) 109 | { 110 | [self.itemsInTable removeObjectIdenticalTo:dInner]; 111 | [self.menuTableView deleteRowsAtIndexPaths:[NSArray arrayWithObject: 112 | [NSIndexPath indexPathForRow:indexToRemove inSection:0] 113 | ] 114 | withRowAnimation:UITableViewRowAnimationLeft]; 115 | } 116 | } 117 | } 118 | 119 | - (UITableViewCell*)createCellWithTitle:(NSString *)title image:(UIImage *)image indexPath:(NSIndexPath*)indexPath 120 | { 121 | NSString *CellIdentifier = @"Cell"; 122 | ExpandableTableViewCell* cell = [self.menuTableView dequeueReusableCellWithIdentifier:CellIdentifier]; 123 | UIView *bgView = [[UIView alloc] init]; 124 | bgView.backgroundColor = [UIColor grayColor]; 125 | cell.selectedBackgroundView = bgView; 126 | cell.lblTitle.text = title; 127 | cell.lblTitle.textColor = [UIColor blackColor]; 128 | 129 | [cell setIndentationLevel:[[[self.itemsInTable objectAtIndex:indexPath.row] valueForKey:@"level"] intValue]]; 130 | cell.indentationWidth = 25; 131 | 132 | float indentPoints = cell.indentationLevel * cell.indentationWidth; 133 | 134 | cell.contentView.frame = CGRectMake(indentPoints,cell.contentView.frame.origin.y,cell.contentView.frame.size.width - indentPoints,cell.contentView.frame.size.height); 135 | 136 | NSDictionary *d1=[self.itemsInTable objectAtIndex:indexPath.row] ; 137 | 138 | if([d1 valueForKey:@"SubItems"]) 139 | { 140 | cell.btnExpand.alpha = 1.0; 141 | [cell.btnExpand addTarget:self action:@selector(showSubItems:) forControlEvents:UIControlEventTouchUpInside]; 142 | } 143 | else 144 | { 145 | cell.btnExpand.alpha = 0.0; 146 | } 147 | return cell; 148 | } 149 | 150 | -(void)showSubItems :(id) sender 151 | { 152 | UIButton *btn = (UIButton*)sender; 153 | CGRect buttonFrameInTableView = [btn convertRect:btn.bounds toView:self.menuTableView]; 154 | NSIndexPath *indexPath = [self.menuTableView indexPathForRowAtPoint:buttonFrameInTableView.origin]; 155 | 156 | if(btn.alpha==1.0) 157 | { 158 | if ([[btn imageForState:UIControlStateNormal] isEqual:[UIImage imageNamed:@"down-arrow.png"]]) 159 | { 160 | [btn setImage:[UIImage imageNamed:@"up-arrow.png"] forState:UIControlStateNormal]; 161 | } 162 | else 163 | { 164 | [btn setImage:[UIImage imageNamed:@"down-arrow.png"] forState:UIControlStateNormal]; 165 | } 166 | 167 | } 168 | 169 | NSDictionary *d=[self.itemsInTable objectAtIndex:indexPath.row] ; 170 | NSArray *arr=[d valueForKey:@"SubItems"]; 171 | if([d valueForKey:@"SubItems"]) 172 | { 173 | BOOL isTableExpanded=NO; 174 | for(NSDictionary *subitems in arr ) 175 | { 176 | NSInteger index=[self.itemsInTable indexOfObjectIdenticalTo:subitems]; 177 | isTableExpanded=(index>0 && index!=NSIntegerMax); 178 | if(isTableExpanded) break; 179 | } 180 | 181 | if(isTableExpanded) 182 | { 183 | [self CollapseRows:arr]; 184 | } 185 | else 186 | { 187 | NSUInteger count=indexPath.row+1; 188 | NSMutableArray *arrCells=[NSMutableArray array]; 189 | for(NSDictionary *dInner in arr ) 190 | { 191 | [arrCells addObject:[NSIndexPath indexPathForRow:count inSection:0]]; 192 | [self.itemsInTable insertObject:dInner atIndex:count++]; 193 | } 194 | [self.menuTableView insertRowsAtIndexPaths:arrCells withRowAnimation:UITableViewRowAnimationLeft]; 195 | } 196 | } 197 | 198 | 199 | } 200 | 201 | 202 | @end 203 | -------------------------------------------------------------------------------- /ExpandableTable.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3FD2BBF61851E41D0006C787 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3FD2BBF51851E41D0006C787 /* Foundation.framework */; }; 11 | 3FD2BBF81851E41D0006C787 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3FD2BBF71851E41D0006C787 /* CoreGraphics.framework */; }; 12 | 3FD2BBFA1851E41D0006C787 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3FD2BBF91851E41D0006C787 /* UIKit.framework */; }; 13 | 3FD2BC001851E41D0006C787 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3FD2BBFE1851E41D0006C787 /* InfoPlist.strings */; }; 14 | 3FD2BC021851E41D0006C787 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FD2BC011851E41D0006C787 /* main.m */; }; 15 | 3FD2BC061851E41D0006C787 /* ExpandableTableAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FD2BC051851E41D0006C787 /* ExpandableTableAppDelegate.m */; }; 16 | 3FD2BC091851E41D0006C787 /* Main_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3FD2BC071851E41D0006C787 /* Main_iPhone.storyboard */; }; 17 | 3FD2BC0C1851E41D0006C787 /* Main_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3FD2BC0A1851E41D0006C787 /* Main_iPad.storyboard */; }; 18 | 3FD2BC111851E41D0006C787 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3FD2BC101851E41D0006C787 /* Images.xcassets */; }; 19 | 3FD2BC181851E41D0006C787 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3FD2BC171851E41D0006C787 /* XCTest.framework */; }; 20 | 3FD2BC191851E41D0006C787 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3FD2BBF51851E41D0006C787 /* Foundation.framework */; }; 21 | 3FD2BC1A1851E41D0006C787 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3FD2BBF91851E41D0006C787 /* UIKit.framework */; }; 22 | 3FD2BC221851E41D0006C787 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3FD2BC201851E41D0006C787 /* InfoPlist.strings */; }; 23 | 3FD2BC241851E41D0006C787 /* ExpandableTableTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FD2BC231851E41D0006C787 /* ExpandableTableTests.m */; }; 24 | 3FD2BC2E1851EAA90006C787 /* data.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3FD2BC2D1851EAA90006C787 /* data.plist */; }; 25 | 3FD2BC311851F0450006C787 /* ExpandableTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FD2BC301851F0450006C787 /* ExpandableTableViewController.m */; }; 26 | 3FD2BC341851F1DB0006C787 /* ExpandableTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FD2BC331851F1DB0006C787 /* ExpandableTableViewCell.m */; }; 27 | 3FEE11911859D93E008FFFF9 /* down-arrow.png in Resources */ = {isa = PBXBuildFile; fileRef = 3FEE11901859D93E008FFFF9 /* down-arrow.png */; }; 28 | 3FEE11931859D946008FFFF9 /* up-arrow.png in Resources */ = {isa = PBXBuildFile; fileRef = 3FEE11921859D946008FFFF9 /* up-arrow.png */; }; 29 | /* End PBXBuildFile section */ 30 | 31 | /* Begin PBXContainerItemProxy section */ 32 | 3FD2BC1B1851E41D0006C787 /* PBXContainerItemProxy */ = { 33 | isa = PBXContainerItemProxy; 34 | containerPortal = 3FD2BBEA1851E41D0006C787 /* Project object */; 35 | proxyType = 1; 36 | remoteGlobalIDString = 3FD2BBF11851E41D0006C787; 37 | remoteInfo = ExpandableTable; 38 | }; 39 | /* End PBXContainerItemProxy section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 3FD2BBF21851E41D0006C787 /* ExpandableTable.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ExpandableTable.app; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 3FD2BBF51851E41D0006C787 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 44 | 3FD2BBF71851E41D0006C787 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 45 | 3FD2BBF91851E41D0006C787 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 46 | 3FD2BBFD1851E41D0006C787 /* ExpandableTable-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ExpandableTable-Info.plist"; sourceTree = ""; }; 47 | 3FD2BBFF1851E41D0006C787 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 48 | 3FD2BC011851E41D0006C787 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 49 | 3FD2BC031851E41D0006C787 /* ExpandableTable-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ExpandableTable-Prefix.pch"; sourceTree = ""; }; 50 | 3FD2BC041851E41D0006C787 /* ExpandableTableAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ExpandableTableAppDelegate.h; sourceTree = ""; }; 51 | 3FD2BC051851E41D0006C787 /* ExpandableTableAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExpandableTableAppDelegate.m; sourceTree = ""; }; 52 | 3FD2BC081851E41D0006C787 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPhone.storyboard; sourceTree = ""; }; 53 | 3FD2BC0B1851E41D0006C787 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPad.storyboard; sourceTree = ""; }; 54 | 3FD2BC101851E41D0006C787 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 55 | 3FD2BC161851E41D0006C787 /* ExpandableTableTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExpandableTableTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | 3FD2BC171851E41D0006C787 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 57 | 3FD2BC1F1851E41D0006C787 /* ExpandableTableTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ExpandableTableTests-Info.plist"; sourceTree = ""; }; 58 | 3FD2BC211851E41D0006C787 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 59 | 3FD2BC231851E41D0006C787 /* ExpandableTableTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExpandableTableTests.m; sourceTree = ""; }; 60 | 3FD2BC2D1851EAA90006C787 /* data.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = data.plist; sourceTree = ""; }; 61 | 3FD2BC2F1851F0450006C787 /* ExpandableTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExpandableTableViewController.h; sourceTree = ""; }; 62 | 3FD2BC301851F0450006C787 /* ExpandableTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExpandableTableViewController.m; sourceTree = ""; }; 63 | 3FD2BC321851F1DB0006C787 /* ExpandableTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExpandableTableViewCell.h; sourceTree = ""; }; 64 | 3FD2BC331851F1DB0006C787 /* ExpandableTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExpandableTableViewCell.m; sourceTree = ""; }; 65 | 3FEE11901859D93E008FFFF9 /* down-arrow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "down-arrow.png"; sourceTree = ""; }; 66 | 3FEE11921859D946008FFFF9 /* up-arrow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "up-arrow.png"; sourceTree = ""; }; 67 | /* End PBXFileReference section */ 68 | 69 | /* Begin PBXFrameworksBuildPhase section */ 70 | 3FD2BBEF1851E41D0006C787 /* Frameworks */ = { 71 | isa = PBXFrameworksBuildPhase; 72 | buildActionMask = 2147483647; 73 | files = ( 74 | 3FD2BBF81851E41D0006C787 /* CoreGraphics.framework in Frameworks */, 75 | 3FD2BBFA1851E41D0006C787 /* UIKit.framework in Frameworks */, 76 | 3FD2BBF61851E41D0006C787 /* Foundation.framework in Frameworks */, 77 | ); 78 | runOnlyForDeploymentPostprocessing = 0; 79 | }; 80 | 3FD2BC131851E41D0006C787 /* Frameworks */ = { 81 | isa = PBXFrameworksBuildPhase; 82 | buildActionMask = 2147483647; 83 | files = ( 84 | 3FD2BC181851E41D0006C787 /* XCTest.framework in Frameworks */, 85 | 3FD2BC1A1851E41D0006C787 /* UIKit.framework in Frameworks */, 86 | 3FD2BC191851E41D0006C787 /* Foundation.framework in Frameworks */, 87 | ); 88 | runOnlyForDeploymentPostprocessing = 0; 89 | }; 90 | /* End PBXFrameworksBuildPhase section */ 91 | 92 | /* Begin PBXGroup section */ 93 | 3FD2BBE91851E41C0006C787 = { 94 | isa = PBXGroup; 95 | children = ( 96 | 3FD2BBFB1851E41D0006C787 /* ExpandableTable */, 97 | 3FD2BC1D1851E41D0006C787 /* ExpandableTableTests */, 98 | 3FD2BBF41851E41D0006C787 /* Frameworks */, 99 | 3FD2BBF31851E41D0006C787 /* Products */, 100 | ); 101 | sourceTree = ""; 102 | }; 103 | 3FD2BBF31851E41D0006C787 /* Products */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 3FD2BBF21851E41D0006C787 /* ExpandableTable.app */, 107 | 3FD2BC161851E41D0006C787 /* ExpandableTableTests.xctest */, 108 | ); 109 | name = Products; 110 | sourceTree = ""; 111 | }; 112 | 3FD2BBF41851E41D0006C787 /* Frameworks */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 3FD2BBF51851E41D0006C787 /* Foundation.framework */, 116 | 3FD2BBF71851E41D0006C787 /* CoreGraphics.framework */, 117 | 3FD2BBF91851E41D0006C787 /* UIKit.framework */, 118 | 3FD2BC171851E41D0006C787 /* XCTest.framework */, 119 | ); 120 | name = Frameworks; 121 | sourceTree = ""; 122 | }; 123 | 3FD2BBFB1851E41D0006C787 /* ExpandableTable */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | 3FD2BC041851E41D0006C787 /* ExpandableTableAppDelegate.h */, 127 | 3FD2BC051851E41D0006C787 /* ExpandableTableAppDelegate.m */, 128 | 3FD2BC071851E41D0006C787 /* Main_iPhone.storyboard */, 129 | 3FD2BC0A1851E41D0006C787 /* Main_iPad.storyboard */, 130 | 3FD2BC2F1851F0450006C787 /* ExpandableTableViewController.h */, 131 | 3FD2BC301851F0450006C787 /* ExpandableTableViewController.m */, 132 | 3FD2BC321851F1DB0006C787 /* ExpandableTableViewCell.h */, 133 | 3FD2BC331851F1DB0006C787 /* ExpandableTableViewCell.m */, 134 | 3FD2BC101851E41D0006C787 /* Images.xcassets */, 135 | 3FD2BBFC1851E41D0006C787 /* Supporting Files */, 136 | ); 137 | path = ExpandableTable; 138 | sourceTree = ""; 139 | }; 140 | 3FD2BBFC1851E41D0006C787 /* Supporting Files */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | 3FEE11921859D946008FFFF9 /* up-arrow.png */, 144 | 3FEE11901859D93E008FFFF9 /* down-arrow.png */, 145 | 3FD2BC2D1851EAA90006C787 /* data.plist */, 146 | 3FD2BBFD1851E41D0006C787 /* ExpandableTable-Info.plist */, 147 | 3FD2BBFE1851E41D0006C787 /* InfoPlist.strings */, 148 | 3FD2BC011851E41D0006C787 /* main.m */, 149 | 3FD2BC031851E41D0006C787 /* ExpandableTable-Prefix.pch */, 150 | ); 151 | name = "Supporting Files"; 152 | sourceTree = ""; 153 | }; 154 | 3FD2BC1D1851E41D0006C787 /* ExpandableTableTests */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | 3FD2BC231851E41D0006C787 /* ExpandableTableTests.m */, 158 | 3FD2BC1E1851E41D0006C787 /* Supporting Files */, 159 | ); 160 | path = ExpandableTableTests; 161 | sourceTree = ""; 162 | }; 163 | 3FD2BC1E1851E41D0006C787 /* Supporting Files */ = { 164 | isa = PBXGroup; 165 | children = ( 166 | 3FD2BC1F1851E41D0006C787 /* ExpandableTableTests-Info.plist */, 167 | 3FD2BC201851E41D0006C787 /* InfoPlist.strings */, 168 | ); 169 | name = "Supporting Files"; 170 | sourceTree = ""; 171 | }; 172 | /* End PBXGroup section */ 173 | 174 | /* Begin PBXNativeTarget section */ 175 | 3FD2BBF11851E41D0006C787 /* ExpandableTable */ = { 176 | isa = PBXNativeTarget; 177 | buildConfigurationList = 3FD2BC271851E41D0006C787 /* Build configuration list for PBXNativeTarget "ExpandableTable" */; 178 | buildPhases = ( 179 | 3FD2BBEE1851E41D0006C787 /* Sources */, 180 | 3FD2BBEF1851E41D0006C787 /* Frameworks */, 181 | 3FD2BBF01851E41D0006C787 /* Resources */, 182 | ); 183 | buildRules = ( 184 | ); 185 | dependencies = ( 186 | ); 187 | name = ExpandableTable; 188 | productName = ExpandableTable; 189 | productReference = 3FD2BBF21851E41D0006C787 /* ExpandableTable.app */; 190 | productType = "com.apple.product-type.application"; 191 | }; 192 | 3FD2BC151851E41D0006C787 /* ExpandableTableTests */ = { 193 | isa = PBXNativeTarget; 194 | buildConfigurationList = 3FD2BC2A1851E41D0006C787 /* Build configuration list for PBXNativeTarget "ExpandableTableTests" */; 195 | buildPhases = ( 196 | 3FD2BC121851E41D0006C787 /* Sources */, 197 | 3FD2BC131851E41D0006C787 /* Frameworks */, 198 | 3FD2BC141851E41D0006C787 /* Resources */, 199 | ); 200 | buildRules = ( 201 | ); 202 | dependencies = ( 203 | 3FD2BC1C1851E41D0006C787 /* PBXTargetDependency */, 204 | ); 205 | name = ExpandableTableTests; 206 | productName = ExpandableTableTests; 207 | productReference = 3FD2BC161851E41D0006C787 /* ExpandableTableTests.xctest */; 208 | productType = "com.apple.product-type.bundle.unit-test"; 209 | }; 210 | /* End PBXNativeTarget section */ 211 | 212 | /* Begin PBXProject section */ 213 | 3FD2BBEA1851E41D0006C787 /* Project object */ = { 214 | isa = PBXProject; 215 | attributes = { 216 | CLASSPREFIX = ExpandableTable; 217 | LastUpgradeCheck = 0500; 218 | ORGANIZATIONNAME = "Manpreet Singh"; 219 | TargetAttributes = { 220 | 3FD2BC151851E41D0006C787 = { 221 | TestTargetID = 3FD2BBF11851E41D0006C787; 222 | }; 223 | }; 224 | }; 225 | buildConfigurationList = 3FD2BBED1851E41D0006C787 /* Build configuration list for PBXProject "ExpandableTable" */; 226 | compatibilityVersion = "Xcode 3.2"; 227 | developmentRegion = English; 228 | hasScannedForEncodings = 0; 229 | knownRegions = ( 230 | en, 231 | Base, 232 | ); 233 | mainGroup = 3FD2BBE91851E41C0006C787; 234 | productRefGroup = 3FD2BBF31851E41D0006C787 /* Products */; 235 | projectDirPath = ""; 236 | projectRoot = ""; 237 | targets = ( 238 | 3FD2BBF11851E41D0006C787 /* ExpandableTable */, 239 | 3FD2BC151851E41D0006C787 /* ExpandableTableTests */, 240 | ); 241 | }; 242 | /* End PBXProject section */ 243 | 244 | /* Begin PBXResourcesBuildPhase section */ 245 | 3FD2BBF01851E41D0006C787 /* Resources */ = { 246 | isa = PBXResourcesBuildPhase; 247 | buildActionMask = 2147483647; 248 | files = ( 249 | 3FEE11931859D946008FFFF9 /* up-arrow.png in Resources */, 250 | 3FD2BC0C1851E41D0006C787 /* Main_iPad.storyboard in Resources */, 251 | 3FEE11911859D93E008FFFF9 /* down-arrow.png in Resources */, 252 | 3FD2BC111851E41D0006C787 /* Images.xcassets in Resources */, 253 | 3FD2BC091851E41D0006C787 /* Main_iPhone.storyboard in Resources */, 254 | 3FD2BC2E1851EAA90006C787 /* data.plist in Resources */, 255 | 3FD2BC001851E41D0006C787 /* InfoPlist.strings in Resources */, 256 | ); 257 | runOnlyForDeploymentPostprocessing = 0; 258 | }; 259 | 3FD2BC141851E41D0006C787 /* Resources */ = { 260 | isa = PBXResourcesBuildPhase; 261 | buildActionMask = 2147483647; 262 | files = ( 263 | 3FD2BC221851E41D0006C787 /* InfoPlist.strings in Resources */, 264 | ); 265 | runOnlyForDeploymentPostprocessing = 0; 266 | }; 267 | /* End PBXResourcesBuildPhase section */ 268 | 269 | /* Begin PBXSourcesBuildPhase section */ 270 | 3FD2BBEE1851E41D0006C787 /* Sources */ = { 271 | isa = PBXSourcesBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | 3FD2BC021851E41D0006C787 /* main.m in Sources */, 275 | 3FD2BC311851F0450006C787 /* ExpandableTableViewController.m in Sources */, 276 | 3FD2BC061851E41D0006C787 /* ExpandableTableAppDelegate.m in Sources */, 277 | 3FD2BC341851F1DB0006C787 /* ExpandableTableViewCell.m in Sources */, 278 | ); 279 | runOnlyForDeploymentPostprocessing = 0; 280 | }; 281 | 3FD2BC121851E41D0006C787 /* Sources */ = { 282 | isa = PBXSourcesBuildPhase; 283 | buildActionMask = 2147483647; 284 | files = ( 285 | 3FD2BC241851E41D0006C787 /* ExpandableTableTests.m in Sources */, 286 | ); 287 | runOnlyForDeploymentPostprocessing = 0; 288 | }; 289 | /* End PBXSourcesBuildPhase section */ 290 | 291 | /* Begin PBXTargetDependency section */ 292 | 3FD2BC1C1851E41D0006C787 /* PBXTargetDependency */ = { 293 | isa = PBXTargetDependency; 294 | target = 3FD2BBF11851E41D0006C787 /* ExpandableTable */; 295 | targetProxy = 3FD2BC1B1851E41D0006C787 /* PBXContainerItemProxy */; 296 | }; 297 | /* End PBXTargetDependency section */ 298 | 299 | /* Begin PBXVariantGroup section */ 300 | 3FD2BBFE1851E41D0006C787 /* InfoPlist.strings */ = { 301 | isa = PBXVariantGroup; 302 | children = ( 303 | 3FD2BBFF1851E41D0006C787 /* en */, 304 | ); 305 | name = InfoPlist.strings; 306 | sourceTree = ""; 307 | }; 308 | 3FD2BC071851E41D0006C787 /* Main_iPhone.storyboard */ = { 309 | isa = PBXVariantGroup; 310 | children = ( 311 | 3FD2BC081851E41D0006C787 /* Base */, 312 | ); 313 | name = Main_iPhone.storyboard; 314 | sourceTree = ""; 315 | }; 316 | 3FD2BC0A1851E41D0006C787 /* Main_iPad.storyboard */ = { 317 | isa = PBXVariantGroup; 318 | children = ( 319 | 3FD2BC0B1851E41D0006C787 /* Base */, 320 | ); 321 | name = Main_iPad.storyboard; 322 | sourceTree = ""; 323 | }; 324 | 3FD2BC201851E41D0006C787 /* InfoPlist.strings */ = { 325 | isa = PBXVariantGroup; 326 | children = ( 327 | 3FD2BC211851E41D0006C787 /* en */, 328 | ); 329 | name = InfoPlist.strings; 330 | sourceTree = ""; 331 | }; 332 | /* End PBXVariantGroup section */ 333 | 334 | /* Begin XCBuildConfiguration section */ 335 | 3FD2BC251851E41D0006C787 /* Debug */ = { 336 | isa = XCBuildConfiguration; 337 | buildSettings = { 338 | ALWAYS_SEARCH_USER_PATHS = NO; 339 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 340 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 341 | CLANG_CXX_LIBRARY = "libc++"; 342 | CLANG_ENABLE_MODULES = YES; 343 | CLANG_ENABLE_OBJC_ARC = YES; 344 | CLANG_WARN_BOOL_CONVERSION = YES; 345 | CLANG_WARN_CONSTANT_CONVERSION = YES; 346 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 347 | CLANG_WARN_EMPTY_BODY = YES; 348 | CLANG_WARN_ENUM_CONVERSION = YES; 349 | CLANG_WARN_INT_CONVERSION = YES; 350 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 351 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 352 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 353 | COPY_PHASE_STRIP = NO; 354 | GCC_C_LANGUAGE_STANDARD = gnu99; 355 | GCC_DYNAMIC_NO_PIC = NO; 356 | GCC_OPTIMIZATION_LEVEL = 0; 357 | GCC_PREPROCESSOR_DEFINITIONS = ( 358 | "DEBUG=1", 359 | "$(inherited)", 360 | ); 361 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 362 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 363 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 364 | GCC_WARN_UNDECLARED_SELECTOR = YES; 365 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 366 | GCC_WARN_UNUSED_FUNCTION = YES; 367 | GCC_WARN_UNUSED_VARIABLE = YES; 368 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 369 | ONLY_ACTIVE_ARCH = YES; 370 | SDKROOT = iphoneos; 371 | TARGETED_DEVICE_FAMILY = "1,2"; 372 | }; 373 | name = Debug; 374 | }; 375 | 3FD2BC261851E41D0006C787 /* Release */ = { 376 | isa = XCBuildConfiguration; 377 | buildSettings = { 378 | ALWAYS_SEARCH_USER_PATHS = NO; 379 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 380 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 381 | CLANG_CXX_LIBRARY = "libc++"; 382 | CLANG_ENABLE_MODULES = YES; 383 | CLANG_ENABLE_OBJC_ARC = YES; 384 | CLANG_WARN_BOOL_CONVERSION = YES; 385 | CLANG_WARN_CONSTANT_CONVERSION = YES; 386 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 387 | CLANG_WARN_EMPTY_BODY = YES; 388 | CLANG_WARN_ENUM_CONVERSION = YES; 389 | CLANG_WARN_INT_CONVERSION = YES; 390 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 391 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 392 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 393 | COPY_PHASE_STRIP = YES; 394 | ENABLE_NS_ASSERTIONS = NO; 395 | GCC_C_LANGUAGE_STANDARD = gnu99; 396 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 397 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 398 | GCC_WARN_UNDECLARED_SELECTOR = YES; 399 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 400 | GCC_WARN_UNUSED_FUNCTION = YES; 401 | GCC_WARN_UNUSED_VARIABLE = YES; 402 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 403 | SDKROOT = iphoneos; 404 | TARGETED_DEVICE_FAMILY = "1,2"; 405 | VALIDATE_PRODUCT = YES; 406 | }; 407 | name = Release; 408 | }; 409 | 3FD2BC281851E41D0006C787 /* Debug */ = { 410 | isa = XCBuildConfiguration; 411 | buildSettings = { 412 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 413 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 414 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 415 | GCC_PREFIX_HEADER = "ExpandableTable/ExpandableTable-Prefix.pch"; 416 | INFOPLIST_FILE = "ExpandableTable/ExpandableTable-Info.plist"; 417 | PRODUCT_NAME = "$(TARGET_NAME)"; 418 | WRAPPER_EXTENSION = app; 419 | }; 420 | name = Debug; 421 | }; 422 | 3FD2BC291851E41D0006C787 /* Release */ = { 423 | isa = XCBuildConfiguration; 424 | buildSettings = { 425 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 426 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 427 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 428 | GCC_PREFIX_HEADER = "ExpandableTable/ExpandableTable-Prefix.pch"; 429 | INFOPLIST_FILE = "ExpandableTable/ExpandableTable-Info.plist"; 430 | PRODUCT_NAME = "$(TARGET_NAME)"; 431 | WRAPPER_EXTENSION = app; 432 | }; 433 | name = Release; 434 | }; 435 | 3FD2BC2B1851E41D0006C787 /* Debug */ = { 436 | isa = XCBuildConfiguration; 437 | buildSettings = { 438 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 439 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/ExpandableTable.app/ExpandableTable"; 440 | FRAMEWORK_SEARCH_PATHS = ( 441 | "$(SDKROOT)/Developer/Library/Frameworks", 442 | "$(inherited)", 443 | "$(DEVELOPER_FRAMEWORKS_DIR)", 444 | ); 445 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 446 | GCC_PREFIX_HEADER = "ExpandableTable/ExpandableTable-Prefix.pch"; 447 | GCC_PREPROCESSOR_DEFINITIONS = ( 448 | "DEBUG=1", 449 | "$(inherited)", 450 | ); 451 | INFOPLIST_FILE = "ExpandableTableTests/ExpandableTableTests-Info.plist"; 452 | PRODUCT_NAME = "$(TARGET_NAME)"; 453 | TEST_HOST = "$(BUNDLE_LOADER)"; 454 | WRAPPER_EXTENSION = xctest; 455 | }; 456 | name = Debug; 457 | }; 458 | 3FD2BC2C1851E41D0006C787 /* Release */ = { 459 | isa = XCBuildConfiguration; 460 | buildSettings = { 461 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 462 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/ExpandableTable.app/ExpandableTable"; 463 | FRAMEWORK_SEARCH_PATHS = ( 464 | "$(SDKROOT)/Developer/Library/Frameworks", 465 | "$(inherited)", 466 | "$(DEVELOPER_FRAMEWORKS_DIR)", 467 | ); 468 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 469 | GCC_PREFIX_HEADER = "ExpandableTable/ExpandableTable-Prefix.pch"; 470 | INFOPLIST_FILE = "ExpandableTableTests/ExpandableTableTests-Info.plist"; 471 | PRODUCT_NAME = "$(TARGET_NAME)"; 472 | TEST_HOST = "$(BUNDLE_LOADER)"; 473 | WRAPPER_EXTENSION = xctest; 474 | }; 475 | name = Release; 476 | }; 477 | /* End XCBuildConfiguration section */ 478 | 479 | /* Begin XCConfigurationList section */ 480 | 3FD2BBED1851E41D0006C787 /* Build configuration list for PBXProject "ExpandableTable" */ = { 481 | isa = XCConfigurationList; 482 | buildConfigurations = ( 483 | 3FD2BC251851E41D0006C787 /* Debug */, 484 | 3FD2BC261851E41D0006C787 /* Release */, 485 | ); 486 | defaultConfigurationIsVisible = 0; 487 | defaultConfigurationName = Release; 488 | }; 489 | 3FD2BC271851E41D0006C787 /* Build configuration list for PBXNativeTarget "ExpandableTable" */ = { 490 | isa = XCConfigurationList; 491 | buildConfigurations = ( 492 | 3FD2BC281851E41D0006C787 /* Debug */, 493 | 3FD2BC291851E41D0006C787 /* Release */, 494 | ); 495 | defaultConfigurationIsVisible = 0; 496 | defaultConfigurationName = Release; 497 | }; 498 | 3FD2BC2A1851E41D0006C787 /* Build configuration list for PBXNativeTarget "ExpandableTableTests" */ = { 499 | isa = XCConfigurationList; 500 | buildConfigurations = ( 501 | 3FD2BC2B1851E41D0006C787 /* Debug */, 502 | 3FD2BC2C1851E41D0006C787 /* Release */, 503 | ); 504 | defaultConfigurationIsVisible = 0; 505 | defaultConfigurationName = Release; 506 | }; 507 | /* End XCConfigurationList section */ 508 | }; 509 | rootObject = 3FD2BBEA1851E41D0006C787 /* Project object */; 510 | } 511 | --------------------------------------------------------------------------------